Add button_icon new attribute to vfs-select widget and changes link button icon

This commit is contained in:
Hadi Nategh 2018-03-28 11:07:47 +02:00
parent 5c19bbfd2c
commit 967fcea673
2 changed files with 9 additions and 2 deletions

View File

@ -183,6 +183,7 @@ var et2_link_to = (function(){ "use strict"; return et2_inputWidget.extend(
var select_attrs = { var select_attrs = {
button_label: egw.lang('Link'), button_label: egw.lang('Link'),
button_caption: '', button_caption: '',
button_icon:'link',
readonly: this.options.readonly, readonly: this.options.readonly,
dialog_title: egw.lang('Link'), dialog_title: egw.lang('Link'),
extra_buttons:[{text: egw.lang("copy"), id:"copy", image: "copy"}, extra_buttons:[{text: egw.lang("copy"), id:"copy", image: "copy"},

View File

@ -916,6 +916,12 @@ var et2_vfsSelect = (function(){ "use strict"; return et2_inputWidget.extend(
description: "Caption for vfs-select button.", description: "Caption for vfs-select button.",
translate:true translate:true
}, },
"button_icon":{
name: "button icon",
type: "string",
default: "check",
description: "Custom icon to show on submit button.",
},
"name": { "name": {
name:"File name", name:"File name",
type: "any", // Object type: "any", // Object
@ -1011,7 +1017,7 @@ var et2_vfsSelect = (function(){ "use strict"; return et2_inputWidget.extend(
{ {
text: egw.lang(_data.content.label), text: egw.lang(_data.content.label),
id:"submit", 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) 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) 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 = []; var files = [];
switch(_data.content.mode) switch(_data.content.mode)