Browse Source

Update add method in plugin manager and return the plugin itself

pull/261/head
Artur Arseniev 9 years ago
parent
commit
22e00c17dd
  1. 3
      src/canvas/view/CanvasView.js
  2. 3
      src/editor/view/EditorView.js
  3. 5
      src/modal_dialog/view/ModalView.js
  4. 8
      src/plugin_manager/index.js

3
src/canvas/view/CanvasView.js

@ -64,7 +64,8 @@ module.exports = Backbone.View.extend({
var em = this.config.em; var em = this.config.em;
if(wrap) { if(wrap) {
var ppfx = this.ppfx; var ppfx = this.ppfx;
var body = this.frame.$el.contents().find('body'); //var body = this.frame.$el.contents().find('body');
var body = $(this.frame.el.contentWindow.document.body);
var cssc = em.get('CssComposer'); var cssc = em.get('CssComposer');
var conf = em.get('Config'); var conf = em.get('Config');
var confCanvas = this.config; var confCanvas = this.config;

3
src/editor/view/EditorView.js

@ -47,9 +47,8 @@ module.exports = Backbone.View.extend({
// Panels // Panels
this.$el.append(this.pn.render()); this.$el.append(this.pn.render());
this.$el.attr('class', this.className); this.$el.attr('class', this.className);
contEl.addClass(conf.stylePrefix + 'editor-cont'); contEl.addClass(conf.stylePrefix + 'editor-cont');
contEl.html(this.$el); contEl.empty().append(this.$el);
return this; return this;
} }

5
src/modal_dialog/view/ModalView.js

@ -89,10 +89,7 @@ module.exports = Backbone.View.extend({
* @private * @private
* */ * */
updateOpen() { updateOpen() {
if(this.model.get('open')) this.el.style.display = this.model.get('open') ? '' : 'none';
this.$el.show();
else
this.$el.hide();
}, },
/** /**

8
src/plugin_manager/index.js

@ -28,10 +28,12 @@ module.exports = config => {
* }); * });
*/ */
add(id, plugin) { add(id, plugin) {
if(plugins[id]) if (plugins[id]) {
return this; return plugins[id];
}
plugins[id] = plugin; plugins[id] = plugin;
return this; return plugin;
}, },
/** /**

Loading…
Cancel
Save