From 78db8563d61a0091e0cb0982c84ca47c3dbad2be Mon Sep 17 00:00:00 2001 From: Murod Khaydarov Date: Tue, 25 Apr 2017 18:05:05 +0300 Subject: [PATCH] fix ce-block data attribute --- plugins/attaches/attaches.js | 6 +++--- plugins/header/header.js | 2 +- plugins/image/image.js | 6 +++--- plugins/list/list.js | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/attaches/attaches.js b/plugins/attaches/attaches.js index 3eb95677..e73685ee 100644 --- a/plugins/attaches/attaches.js +++ b/plugins/attaches/attaches.js @@ -217,7 +217,7 @@ var cdxAttaches = function () { upload.current = progress; - codex.editor.content.switchBlock(codex.editor.content.currentNode, progress); + codex.editor.content.switchBlock(codex.editor.content.currentNode, progress, 'attaches'); }, @@ -261,7 +261,7 @@ var cdxAttaches = function () { data.size = Math.ceil(data.size / KBYTE) || 1; uploadedFile = ui.uploadedFile(data); - codex.editor.content.switchBlock(upload.current, uploadedFile); + codex.editor.content.switchBlock(upload.current, uploadedFile, 'attaches'); uploadedFile.querySelector('input').focus(); @@ -290,7 +290,7 @@ var cdxAttaches = function () { var defaultFrom = ui.defaultForm(); - codex.editor.content.switchBlock(upload.current, defaultFrom); + codex.editor.content.switchBlock(upload.current, defaultFrom, 'attaches'); if (!upload.aborted) { diff --git a/plugins/header/header.js b/plugins/header/header.js index 78a96815..6e73ee88 100644 --- a/plugins/header/header.js +++ b/plugins/header/header.js @@ -39,7 +39,7 @@ var header = (function(header_plugin) { new_header.setAttribute('data-placeholder', 'Заголовок'); new_header.dataset.headerData = type; - codex.editor.content.switchBlock(old_header, new_header); + codex.editor.content.switchBlock(old_header, new_header, 'header'); /** Close settings after replacing */ codex.editor.toolbar.settings.close(); diff --git a/plugins/image/image.js b/plugins/image/image.js index 1d49d095..b0b83746 100644 --- a/plugins/image/image.js +++ b/plugins/image/image.js @@ -359,7 +359,7 @@ var image = (function(image_plugin) { var newImage = make_(data); - codex.editor.content.switchBlock(image.holder, newImage); + codex.editor.content.switchBlock(image.holder, newImage, 'image'); newImage.classList.add(elementClasses_.imagePreview); /** @@ -404,7 +404,7 @@ var image = (function(image_plugin) { var oldHolder = image.holder; var form = ui_.makeForm(); - codex.editor.content.switchBlock(oldHolder, form); + codex.editor.content.switchBlock(oldHolder, form, 'image'); } }, @@ -467,7 +467,7 @@ var image = (function(image_plugin) { var img = image.querySelector('img'); - codex.editor.content.switchBlock(codex.editor.content.currentNode, image); + codex.editor.content.switchBlock(codex.editor.content.currentNode, image, 'image'); }; diff --git a/plugins/list/list.js b/plugins/list/list.js index 3b7bc5a2..5cdef435 100644 --- a/plugins/list/list.js +++ b/plugins/list/list.js @@ -74,7 +74,7 @@ var list = (function(list_plugin) { newEditable.innerHTML = oldEditable.innerHTML; newEditable.classList.add(elementClasses_.pluginWrapper); - codex.editor.content.switchBlock(currentBlock, newEditable); + codex.editor.content.switchBlock(currentBlock, newEditable, 'list'); }, keyDown: function (e) {