diff --git a/assets/js/src/newsletter_editor/blocks/divider.js b/assets/js/src/newsletter_editor/blocks/divider.js index 352823708c..e5684d299c 100644 --- a/assets/js/src/newsletter_editor/blocks/divider.js +++ b/assets/js/src/newsletter_editor/blocks/divider.js @@ -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'); } }); diff --git a/assets/js/src/newsletter_editor/blocks/image.js b/assets/js/src/newsletter_editor/blocks/image.js index b05d4d2b80..2b9c69660c 100644 --- a/assets/js/src/newsletter_editor/blocks/image.js +++ b/assets/js/src/newsletter_editor/blocks/image.js @@ -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); }, diff --git a/assets/js/src/newsletter_editor/tinymce/mailpoet_shortcodes/plugin.js b/assets/js/src/newsletter_editor/tinymce/mailpoet_shortcodes/plugin.js index 5a257903ed..2afa9cd21e 100644 --- a/assets/js/src/newsletter_editor/tinymce/mailpoet_shortcodes/plugin.js +++ b/assets/js/src/newsletter_editor/tinymce/mailpoet_shortcodes/plugin.js @@ -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,