Fix eslint rules
[MAILPOET-1348]
This commit is contained in:
@ -61,7 +61,7 @@ define([
|
|||||||
},
|
},
|
||||||
templateContext: function templateContext() {
|
templateContext: function templateContext() {
|
||||||
return _.extend({
|
return _.extend({
|
||||||
totalHeight: (parseInt(this.model.get('styles.block.padding'), 10) * 2) + parseInt(this.model.get('styles.block.borderWidth')) + 'px'
|
totalHeight: (parseInt(this.model.get('styles.block.padding'), 10) * 2) + parseInt(this.model.get('styles.block.borderWidth'), 10) + 'px'
|
||||||
}, base.BlockView.prototype.templateContext.apply(this));
|
}, base.BlockView.prototype.templateContext.apply(this));
|
||||||
},
|
},
|
||||||
onRender: function onRender() {
|
onRender: function onRender() {
|
||||||
@ -75,7 +75,7 @@ define([
|
|||||||
changePadding: function changePadding() {
|
changePadding: function changePadding() {
|
||||||
this.$('.mailpoet_content').css('padding-top', this.model.get('styles.block.padding'));
|
this.$('.mailpoet_content').css('padding-top', this.model.get('styles.block.padding'));
|
||||||
this.$('.mailpoet_content').css('padding-bottom', this.model.get('styles.block.padding'));
|
this.$('.mailpoet_content').css('padding-bottom', this.model.get('styles.block.padding'));
|
||||||
this.$('.mailpoet_resize_handle_text').text((parseInt(this.model.get('styles.block.padding'), 10) * 2) + parseInt(this.model.get('styles.block.borderWidth')) + 'px');
|
this.$('.mailpoet_resize_handle_text').text((parseInt(this.model.get('styles.block.padding'), 10) * 2) + parseInt(this.model.get('styles.block.borderWidth'), 10) + 'px');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -111,12 +111,12 @@ define([
|
|||||||
callable(event);
|
callable(event);
|
||||||
},
|
},
|
||||||
updateMaxWidth: function () {
|
updateMaxWidth: function () {
|
||||||
var maxWidth = parseInt(this.model.get('maxWidth'));
|
var maxWidth = parseInt(this.model.get('maxWidth'), 10);
|
||||||
this.$('.mailpoet_field_image_width').attr('max', maxWidth);
|
this.$('.mailpoet_field_image_width').attr('max', maxWidth);
|
||||||
this.$('.mailpoet_field_image_width_input').attr('max', maxWidth);
|
this.$('.mailpoet_field_image_width_input').attr('max', maxWidth);
|
||||||
},
|
},
|
||||||
updateWidth: function () {
|
updateWidth: function () {
|
||||||
var width = parseInt(this.model.get('width'));
|
var width = parseInt(this.model.get('width'), 10);
|
||||||
this.$('.mailpoet_field_image_width').val(width);
|
this.$('.mailpoet_field_image_width').val(width);
|
||||||
this.$('.mailpoet_field_image_width_input').val(width);
|
this.$('.mailpoet_field_image_width_input').val(width);
|
||||||
},
|
},
|
||||||
|
@ -10,27 +10,26 @@
|
|||||||
|
|
||||||
/* jshint unused:false */
|
/* jshint unused:false */
|
||||||
/* global tinymce:true */
|
/* global tinymce:true */
|
||||||
tinymce.PluginManager.add('mailpoet_shortcodes', function (editor) { // eslint-disable-line func-names
|
tinymce.PluginManager.add('mailpoet_shortcodes', function tinyMceAdd(editor) {
|
||||||
var appendLabelAndClose = function (shortcode) { // eslint-disable-line func-names
|
var appendLabelAndClose = function appendLabelAndCLose(shortcode) {
|
||||||
editor.insertContent(shortcode);
|
editor.insertContent(shortcode);
|
||||||
editor.windowManager.close();
|
editor.windowManager.close();
|
||||||
};
|
};
|
||||||
var generateOnClickFunc = function (shortcode) { // eslint-disable-line func-names
|
var generateOnClickFunc = function generateOnClickFunc(shortcode) {
|
||||||
return function () { // eslint-disable-line func-names
|
return function appendAndClose() {
|
||||||
appendLabelAndClose(shortcode);
|
appendLabelAndClose(shortcode);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
editor.addButton('mailpoet_shortcodes', {
|
editor.addButton('mailpoet_shortcodes', {
|
||||||
icon: 'mailpoet_shortcodes',
|
icon: 'mailpoet_shortcodes',
|
||||||
onclick: function () { // eslint-disable-line func-names
|
onclick: function onClick() {
|
||||||
var shortcodes = [];
|
var shortcodes = [];
|
||||||
var configShortcodes = editor.settings.mailpoet_shortcodes;
|
var configShortcodes = editor.settings.mailpoet_shortcodes;
|
||||||
var segment;
|
|
||||||
var i;
|
var i;
|
||||||
|
|
||||||
for (segment in configShortcodes) {
|
Object.keys(configShortcodes).forEach(function configShortcodesLoop(segment) {
|
||||||
if (configShortcodes.hasOwnProperty(segment)) {
|
if (Object.prototype.hasOwnProperty.call(configShortcodes, segment)) {
|
||||||
shortcodes.push({
|
shortcodes.push({
|
||||||
type: 'label',
|
type: 'label',
|
||||||
text: segment
|
text: segment
|
||||||
@ -44,12 +43,12 @@ tinymce.PluginManager.add('mailpoet_shortcodes', function (editor) { // eslint-d
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
|
|
||||||
// Open window
|
// Open window
|
||||||
editor.windowManager.open({
|
editor.windowManager.open({
|
||||||
height: parseInt(editor.getParam('plugin_mailpoet_shortcodes_height', 400)),
|
height: parseInt(editor.getParam('plugin_mailpoet_shortcodes_height', 400), 10),
|
||||||
width: parseInt(editor.getParam('plugin_mailpoet_shortcodes_width', 450)),
|
width: parseInt(editor.getParam('plugin_mailpoet_shortcodes_width', 450), 10),
|
||||||
autoScroll: true,
|
autoScroll: true,
|
||||||
title: editor.settings.mailpoet_shortcodes_window_title,
|
title: editor.settings.mailpoet_shortcodes_window_title,
|
||||||
body: shortcodes,
|
body: shortcodes,
|
||||||
|
Reference in New Issue
Block a user