|
|
@ -10,7 +10,7 @@ import { |
|
|
import $ from 'cash-dom'; |
|
|
import $ from 'cash-dom'; |
|
|
import Backbone from 'backbone'; |
|
|
import Backbone from 'backbone'; |
|
|
import Extender from 'utils/extender'; |
|
|
import Extender from 'utils/extender'; |
|
|
import { getModel } from 'utils/mixins'; |
|
|
import { getModel, hasWin } from 'utils/mixins'; |
|
|
import Selected from './Selected'; |
|
|
import Selected from './Selected'; |
|
|
|
|
|
|
|
|
Backbone.$ = $; |
|
|
Backbone.$ = $; |
|
|
@ -786,7 +786,7 @@ export default Backbone.Model.extend({ |
|
|
* Destroy editor |
|
|
* Destroy editor |
|
|
*/ |
|
|
*/ |
|
|
destroyAll() { |
|
|
destroyAll() { |
|
|
const { config } = this; |
|
|
const { config, view } = this; |
|
|
const editor = this.getEditor(); |
|
|
const editor = this.getEditor(); |
|
|
const { editors = [] } = config.grapesjs || {}; |
|
|
const { editors = [] } = config.grapesjs || {}; |
|
|
this.stopDefault(); |
|
|
this.stopDefault(); |
|
|
@ -794,7 +794,7 @@ export default Backbone.Model.extend({ |
|
|
.slice() |
|
|
.slice() |
|
|
.reverse() |
|
|
.reverse() |
|
|
.forEach(mod => mod.destroy()); |
|
|
.forEach(mod => mod.destroy()); |
|
|
this.view.remove(); |
|
|
view && view.remove(); |
|
|
this.stopListening(); |
|
|
this.stopListening(); |
|
|
this.clear({ silent: true }); |
|
|
this.clear({ silent: true }); |
|
|
this.destroyed = 1; |
|
|
this.destroyed = 1; |
|
|
@ -802,9 +802,10 @@ export default Backbone.Model.extend({ |
|
|
i => (this[i] = {}) |
|
|
i => (this[i] = {}) |
|
|
); |
|
|
); |
|
|
editors.splice(editors.indexOf(editor), 1); |
|
|
editors.splice(editors.indexOf(editor), 1); |
|
|
$(config.el) |
|
|
hasWin() && |
|
|
.empty() |
|
|
$(config.el) |
|
|
.attr(this.attrsOrig); |
|
|
.empty() |
|
|
|
|
|
.attr(this.attrsOrig); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getEditing() { |
|
|
getEditing() { |
|
|
|