View | Details | Raw Unified | Return to bug 33483
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue (-6 / +20 lines)
Lines 85-103 export default { Link Here
85
                    searchable: false,
85
                    searchable: false,
86
                    render: (data, type, row) => {
86
                    render: (data, type, row) => {
87
                        let content = []
87
                        let content = []
88
                        this.actions["-1"].forEach(a => {
88
                        this.actions["-1"].forEach(action => {
89
                            if (a == "edit") {
89
                            if (typeof action === "object") {
90
                                let action_name = Object.keys(action)[0]
91
                                content.push(
92
                                    `<a class="${action_name} btn btn-default btn-xs" role="button"><i class="${action[action_name].icon}"></i>${action[action_name].text}</a>`
93
                                )
94
                            } else if (action == "edit") {
90
                                content.push(
95
                                content.push(
91
                                    '<a class="edit btn btn-default btn-xs" role="button"><i class="fa fa-pencil"></i>' +
96
                                    '<a class="edit btn btn-default btn-xs" role="button"><i class="fa fa-pencil"></i>' +
92
                                        this.$__("Edit") +
97
                                        this.$__("Edit") +
93
                                        "</a>"
98
                                        "</a>"
94
                                )
99
                                )
95
                            } else if (a == "delete") {
100
                            } else if (action == "delete") {
96
                                content.push(
101
                                content.push(
97
                                    '<a class="delete btn btn-default btn-xs" role="button"><i class="fa fa-trash"></i>' +
102
                                    '<a class="delete btn btn-default btn-xs" role="button"><i class="fa fa-trash"></i>' +
98
                                        this.$__("Delete") +
103
                                        this.$__("Delete") +
99
                                        "</a>"
104
                                        "</a>"
100
                                )
105
                                )
106
                            } else if (action == "remove") {
107
                                content.push(
108
                                    '<a class="remove btn btn-default btn-xs" role="button"><i class="fa fa-remove"></i>' +
109
                                        this.$__("Remove") +
110
                                        "</a>"
111
                                )
101
                            }
112
                            }
102
                        })
113
                        })
103
                        return content.join(" ")
114
                        return content.join(" ")
Lines 157-164 export default { Link Here
157
                        .each(function (idx) {
168
                        .each(function (idx) {
158
                            const data = dataSet[idx]
169
                            const data = dataSet[idx]
159
                            actions.forEach(action => {
170
                            actions.forEach(action => {
160
                                $("." + action, this).on("click", e => {
171
                                let action_name =
161
                                    self.$emit(action, data, dt, e)
172
                                    typeof action === "object"
173
                                        ? Object.keys(action)[0]
174
                                        : action
175
                                $("." + action_name, this).on("click", e => {
176
                                    self.$emit(action_name, data, dt, e)
162
                                })
177
                                })
163
                            })
178
                            })
164
                        })
179
                        })
165
- 

Return to bug 33483