Fix eslint rules

[MAILPOET-1348]
This commit is contained in:
Pavel Dohnal
2018-04-18 11:16:02 +01:00
parent a535e59450
commit 566db67e8c
3 changed files with 14 additions and 15 deletions

View File

@ -61,7 +61,7 @@ define([
},
templateContext: function templateContext() {
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));
},
onRender: function onRender() {
@ -75,7 +75,7 @@ define([
changePadding: function changePadding() {
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_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');
}
});

View File

@ -111,12 +111,12 @@ define([
callable(event);
},
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_input').attr('max', maxWidth);
},
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_input').val(width);
},

View File

@ -10,27 +10,26 @@
/* jshint unused:false */
/* global tinymce:true */
tinymce.PluginManager.add('mailpoet_shortcodes', function (editor) { // eslint-disable-line func-names
var appendLabelAndClose = function (shortcode) { // eslint-disable-line func-names
tinymce.PluginManager.add('mailpoet_shortcodes', function tinyMceAdd(editor) {
var appendLabelAndClose = function appendLabelAndCLose(shortcode) {
editor.insertContent(shortcode);
editor.windowManager.close();
};
var generateOnClickFunc = function (shortcode) { // eslint-disable-line func-names
return function () { // eslint-disable-line func-names
var generateOnClickFunc = function generateOnClickFunc(shortcode) {
return function appendAndClose() {
appendLabelAndClose(shortcode);
};
};
editor.addButton('mailpoet_shortcodes', {
icon: 'mailpoet_shortcodes',
onclick: function () { // eslint-disable-line func-names
onclick: function onClick() {
var shortcodes = [];
var configShortcodes = editor.settings.mailpoet_shortcodes;
var segment;
var i;
for (segment in configShortcodes) {
if (configShortcodes.hasOwnProperty(segment)) {
Object.keys(configShortcodes).forEach(function configShortcodesLoop(segment) {
if (Object.prototype.hasOwnProperty.call(configShortcodes, segment)) {
shortcodes.push({
type: 'label',
text: segment
@ -44,12 +43,12 @@ tinymce.PluginManager.add('mailpoet_shortcodes', function (editor) { // eslint-d
});
}
}
}
});
// Open window
editor.windowManager.open({
height: parseInt(editor.getParam('plugin_mailpoet_shortcodes_height', 400)),
width: parseInt(editor.getParam('plugin_mailpoet_shortcodes_width', 450)),
height: parseInt(editor.getParam('plugin_mailpoet_shortcodes_height', 400), 10),
width: parseInt(editor.getParam('plugin_mailpoet_shortcodes_width', 450), 10),
autoScroll: true,
title: editor.settings.mailpoet_shortcodes_window_title,
body: shortcodes,