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 747d45e47c
commit df70d71cc3
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 = {
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"},

View File

@ -928,6 +928,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
@ -1023,7 +1029,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)
@ -1046,7 +1052,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)