mirror of
https://github.com/codex-team/editor.js
synced 2024-06-07 16:32:22 +02:00
plugins improved
This commit is contained in:
parent
68d2f8fb1e
commit
ef714fa5dd
|
@ -175,14 +175,9 @@
|
|||
embed: {
|
||||
type: 'embed',
|
||||
make: embed.make,
|
||||
appendCallback: null,
|
||||
settings: null,
|
||||
render: embed.render,
|
||||
save: embed.save,
|
||||
validate: embed.validate,
|
||||
displayInToolbox: false,
|
||||
enableLineBreaks: false,
|
||||
allowedToPaste: false
|
||||
}
|
||||
},
|
||||
data : {
|
||||
|
|
|
@ -7,7 +7,7 @@ var embed = function(embed){
|
|||
var methods = {
|
||||
|
||||
addInternal: function (content) {
|
||||
codex.content.switchBlock(codex.content.currentNode, content, 'embed');
|
||||
codex.content.switchBlock(codex.content.currentNode, content, 'video_extended');
|
||||
|
||||
var blockContent = codex.content.currentNode.childNodes[0];
|
||||
blockContent.classList.add('embed__loader');
|
||||
|
|
|
@ -9,15 +9,11 @@ var instagram = (function(instagram) {
|
|||
render : function(content) {
|
||||
|
||||
codex.content.switchBlock(codex.content.currentNode, content, 'instagram');
|
||||
|
||||
setTimeout(function() {
|
||||
window.instgrm.Embeds.process();
|
||||
}, 200);
|
||||
|
||||
var blockContent = codex.content.currentNode.childNodes[0];
|
||||
blockContent.classList.add('instagram__loader');
|
||||
|
||||
window.instgrm.Embeds.process();
|
||||
|
||||
setTimeout(function(){
|
||||
blockContent.classList.remove('instagram__loader');
|
||||
}, 500);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -59,9 +55,11 @@ var instagram = (function(instagram) {
|
|||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
* Make instagram embed via Widgets method
|
||||
*/
|
||||
instagram.make = function(data, isInternal) {
|
||||
var make_ = function(data, isInternal) {
|
||||
|
||||
if (!data.instagram_url)
|
||||
return;
|
||||
|
@ -123,7 +121,7 @@ var instagram = (function(instagram) {
|
|||
* Render data
|
||||
*/
|
||||
instagram.render = function(data) {
|
||||
return instagram.make(data);
|
||||
return make_(data);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -136,11 +134,11 @@ var instagram = (function(instagram) {
|
|||
instagram_url: url
|
||||
};
|
||||
|
||||
codex.tools.instagram.make(data, true);
|
||||
make_(data, true);
|
||||
|
||||
};
|
||||
|
||||
|
||||
return instagram;
|
||||
|
||||
})({});
|
||||
|
||||
|
|
Loading…
Reference in a new issue