From 967fcea673d18bd5afe876b9cc1a9e7697f3329d Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Wed, 28 Mar 2018 11:07:47 +0200 Subject: [PATCH] Add button_icon new attribute to vfs-select widget and changes link button icon --- api/js/etemplate/et2_widget_link.js | 1 + api/js/etemplate/et2_widget_vfs.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/et2_widget_link.js b/api/js/etemplate/et2_widget_link.js index 4f4232ffc7..470722673c 100644 --- a/api/js/etemplate/et2_widget_link.js +++ b/api/js/etemplate/et2_widget_link.js @@ -183,6 +183,7 @@ var et2_link_to = (function(){ "use strict"; return et2_inputWidget.extend( var select_attrs = { button_label: egw.lang('Link'), button_caption: '', + button_icon:'link', readonly: this.options.readonly, dialog_title: egw.lang('Link'), extra_buttons:[{text: egw.lang("copy"), id:"copy", image: "copy"}, diff --git a/api/js/etemplate/et2_widget_vfs.js b/api/js/etemplate/et2_widget_vfs.js index ace0975675..66b3c7b977 100644 --- a/api/js/etemplate/et2_widget_vfs.js +++ b/api/js/etemplate/et2_widget_vfs.js @@ -916,6 +916,12 @@ var et2_vfsSelect = (function(){ "use strict"; return et2_inputWidget.extend( description: "Caption for vfs-select button.", translate:true }, + "button_icon":{ + name: "button icon", + type: "string", + default: "check", + description: "Custom icon to show on submit button.", + }, "name": { name:"File name", type: "any", // Object @@ -1011,7 +1017,7 @@ var et2_vfsSelect = (function(){ "use strict"; return et2_inputWidget.extend( { text: egw.lang(_data.content.label), id:"submit", - image:_data.content.mode.match(/saveas|select-dir/) ? "save" : "check" + image: _data.content.mode.match(/saveas|select-dir/) ? "save" : this.options.button_icon } ]; if (this.options.extra_buttons && this.options.method) @@ -1034,7 +1040,7 @@ var et2_vfsSelect = (function(){ "use strict"; return et2_inputWidget.extend( { callback: function(_button_id, _value) { - if ((_button_id == 'submit' || extra_buttons_action[_button_id]) && _value) + if ((_button_id == 'submit' || (extra_buttons_action && extra_buttons_action[_button_id])) && _value) { var files = []; switch(_data.content.mode)