Skip to content

Commit

Permalink
fix es6 function in build
Browse files Browse the repository at this point in the history
  • Loading branch information
albertosouza committed Dec 20, 2017
1 parent 978b84a commit df8367f
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions files/public/we-plugin-widget.js
Expand Up @@ -54,30 +54,25 @@

optionsCache: {},

formatFormOption: function formatFormOption (item) {
formatFormOption: function(item) {
if (!item.id) return ' ';

var tags;

if (item.description) {
tags = '<div><span class="widget-option-name">'+item.text+'</span>'
tags = '<div><span class="widget-option-name">'+item.text+'</span>';
tags += '<br>';
tags += '<span class="widget-option-desc">'+item.description+'</span>';
tags += '</div>';

we.structure.optionsCache[item.id] = tags;
} else {
tags = we.structure.optionsCache[item.id];
}

var $item = $(tags);

return $item;
return $(tags);
},

openAddWidgetForm: function openAddWidgetForm(regionName) {
var self = this;

openAddWidgetForm: function (regionName) {
var modal = $(we.structure.addWidgetModalFormId);
if (!modal) throw new Error('Add widget modal not found!', we.structure.addWidgetModalFormId);

Expand All @@ -96,11 +91,11 @@
data: {}
}).then(function afterGetWidgetTypes(r) {
$('#AddWidgetFormModal-select-type').select2({
templateResult: self.formatFormOption,
data: r.widget.map(function (w){
templateResult: this.formatFormOption,
data: r.widget.map(function (w) {
return {
id : w.type,
text: w.label+' ('+w.type+')',
text: (w.label+' ('+w.type+')'),
description: w.description
};
})
Expand Down Expand Up @@ -223,7 +218,7 @@
});
});
},
resetFormActions(modal) {
resetFormActions: function(modal) {
modal.find('.steps-body .step2').text('');
modal.find('form').off();
modal.find('form').off('submit');
Expand Down

0 comments on commit df8367f

Please sign in to comment.