@the-grid/ed
Advanced tools
Comparing version 1.3.3 to 1.3.4
### dev | ||
### 1.3.4 - 2017-01-18 | ||
* Fix plugin `detach` to cleanup listener leaks :non-potable_water: | ||
### 1.3.3 - 2016-12-11 | ||
@@ -4,0 +8,0 @@ |
@@ -163,4 +163,2 @@ 'use strict'; | ||
// this.plugins = pluginsToInit.map((Plugin) => new Plugin(pluginOptions)) | ||
onChange('EDITABLE_INITIALIZE', this); | ||
@@ -171,2 +169,4 @@ } | ||
value: function componentWillUnmount() { | ||
var _this3 = this; | ||
// this.pm.off('change') | ||
@@ -176,3 +176,6 @@ // this.pm.off('ed.plugin.url') | ||
// this.pm.off('drop', this.boundOnDrop) | ||
// this.plugins.forEach((plugin) => plugin.teardown()) | ||
var pluginKeys = Object.keys(this.pm.plugin); | ||
pluginKeys.forEach(function (key) { | ||
return _this3.pm.plugin[key].detach(); | ||
}); | ||
} | ||
@@ -179,0 +182,0 @@ }, { |
@@ -31,4 +31,4 @@ 'use strict'; | ||
_createClass(CommandsInterface, [{ | ||
key: 'teardown', | ||
value: function teardown() { | ||
key: 'detach', | ||
value: function detach() { | ||
this.updater.detach(); | ||
@@ -35,0 +35,0 @@ } |
@@ -44,4 +44,4 @@ 'use strict'; | ||
_createClass(WidgetBase, [{ | ||
key: 'teardown', | ||
value: function teardown() { | ||
key: 'detach', | ||
value: function detach() { | ||
this.el.parentNode.removeChild(this.el); | ||
@@ -48,0 +48,0 @@ } |
@@ -90,8 +90,8 @@ 'use strict'; | ||
_createClass(WidgetIframe, [{ | ||
key: 'teardown', | ||
value: function teardown() { | ||
key: 'detach', | ||
value: function detach() { | ||
if (this.initialBlock) { | ||
this.frame.removeEventListener('load', this.postInitialBlock); | ||
} | ||
_get(WidgetIframe.prototype.__proto__ || Object.getPrototypeOf(WidgetIframe.prototype), 'teardown', this).call(this); | ||
_get(WidgetIframe.prototype.__proto__ || Object.getPrototypeOf(WidgetIframe.prototype), 'detach', this).call(this); | ||
} | ||
@@ -98,0 +98,0 @@ }, { |
@@ -127,2 +127,4 @@ 'use strict'; | ||
this.el.parentNode.removeChild(this.el); | ||
this.ed.trigger('plugin.widget.one.detach'); | ||
} | ||
@@ -182,3 +184,3 @@ }, { | ||
// Need to re-initialize new widget type | ||
widget.teardown(); | ||
widget.detach(); | ||
needsReInit = true; | ||
@@ -185,0 +187,0 @@ } |
@@ -68,5 +68,2 @@ 'use strict'; | ||
_createClass(EdStore, [{ | ||
key: 'teardown', | ||
value: function teardown() {} | ||
}, { | ||
key: 'routeChange', | ||
@@ -73,0 +70,0 @@ value: function routeChange(type, payload) { |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "1.3.3", | ||
"version": "1.3.4", | ||
"description": "the grid api with prosemirror", | ||
@@ -32,13 +32,13 @@ "main": "dist/ed.js", | ||
"dependencies": { | ||
"@the-grid/ced": "0.1.2", | ||
"@the-grid/ced": "0.1.3", | ||
"@the-grid/ed-location": "2.0.1", | ||
"@the-grid/ed-userhtml": "0.2.1", | ||
"@the-grid/ed-userhtml": "0.3.0", | ||
"he": "1.1.0", | ||
"imgflo-url": "1.1.0", | ||
"lodash": "4.14.1", | ||
"imgflo-url": "1.2.0", | ||
"lodash": "4.17.4", | ||
"prosemirror": "0.10.1", | ||
"react": "15.3.1", | ||
"react-dom": "15.3.1", | ||
"react": "15.4.2", | ||
"react-dom": "15.4.2", | ||
"rebass": "0.3.3", | ||
"uuid": "2.0.2" | ||
"uuid": "3.0.1" | ||
}, | ||
@@ -67,21 +67,21 @@ "widgets": { | ||
"devDependencies": { | ||
"babel-cli": "6.11.4", | ||
"babel-core": "6.11.4", | ||
"babel-eslint": "6.1.2", | ||
"babel-loader": "6.2.4", | ||
"babel-preset-es2015": "6.9.0", | ||
"babel-cli": "6.18.0", | ||
"babel-core": "6.21.0", | ||
"babel-eslint": "7.1.1", | ||
"babel-loader": "6.2.10", | ||
"babel-preset-es2015": "6.18.0", | ||
"bob-ross-lipsum": "1.1.1", | ||
"chai": "3.5.0", | ||
"copy-webpack-plugin": "3.0.1", | ||
"eslint": "3.1.1", | ||
"eslint-config-standard": "5.3.5", | ||
"eslint-plugin-promise": "2.0.0", | ||
"eslint-plugin-react": "5.2.2", | ||
"eslint-plugin-standard": "2.0.0", | ||
"copy-webpack-plugin": "4.0.1", | ||
"eslint": "3.13.1", | ||
"eslint-config-standard": "6.2.1", | ||
"eslint-plugin-promise": "3.4.0", | ||
"eslint-plugin-react": "6.9.0", | ||
"eslint-plugin-standard": "2.0.1", | ||
"estraverse": "4.2.0", | ||
"estraverse-fb": "1.3.1", | ||
"gremlins.js": "marmelab/gremlins.js", | ||
"html-flatten": "0.3.5", | ||
"html-flatten": "0.3.6", | ||
"json-loader": "0.5.4", | ||
"karma": "1.3.0", | ||
"karma": "1.4.0", | ||
"karma-browserstack-launcher": "1.1.1", | ||
@@ -92,13 +92,13 @@ "karma-chai": "0.1.0", | ||
"karma-firefox-launcher": "1.0.0", | ||
"karma-mocha": "1.2.0", | ||
"karma-mocha-reporter": "2.2.0", | ||
"karma-mocha": "1.3.0", | ||
"karma-mocha-reporter": "2.2.1", | ||
"karma-sourcemap-loader": "0.3.7", | ||
"karma-webpack": "1.8.0", | ||
"mocha": "2.5.3", | ||
"mocha-loader": "0.7.1", | ||
"karma-webpack": "2.0.1", | ||
"mocha": "3.2.0", | ||
"mocha-loader": "1.1.0", | ||
"raw-loader": "0.5.1", | ||
"style-loader": "0.13.1", | ||
"webpack": "1.13.1", | ||
"webpack-dev-server": "1.14.1" | ||
"webpack": "1.14.0", | ||
"webpack-dev-server": "1.16.2" | ||
} | ||
} |
@@ -110,4 +110,2 @@ require('./editable.css') | ||
// this.plugins = pluginsToInit.map((Plugin) => new Plugin(pluginOptions)) | ||
onChange('EDITABLE_INITIALIZE', this) | ||
@@ -120,3 +118,4 @@ } | ||
// this.pm.off('drop', this.boundOnDrop) | ||
// this.plugins.forEach((plugin) => plugin.teardown()) | ||
const pluginKeys = Object.keys(this.pm.plugin) | ||
pluginKeys.forEach((key) => this.pm.plugin[key].detach()) | ||
} | ||
@@ -123,0 +122,0 @@ onDrop (event) { |
@@ -20,3 +20,3 @@ import {edCommands} from '../menu/ed-menu' | ||
} | ||
teardown () { | ||
detach () { | ||
this.updater.detach() | ||
@@ -23,0 +23,0 @@ } |
@@ -24,3 +24,3 @@ export default class WidgetBase { | ||
} | ||
teardown () { | ||
detach () { | ||
this.el.parentNode.removeChild(this.el) | ||
@@ -27,0 +27,0 @@ } |
@@ -51,7 +51,7 @@ import WidgetBase from './widget-base' | ||
} | ||
teardown () { | ||
detach () { | ||
if (this.initialBlock) { | ||
this.frame.removeEventListener('load', this.postInitialBlock) | ||
} | ||
super.teardown() | ||
super.detach() | ||
} | ||
@@ -58,0 +58,0 @@ getHeight () { |
@@ -107,2 +107,4 @@ /* | ||
this.el.parentNode.removeChild(this.el) | ||
this.ed.trigger('plugin.widget.one.detach') | ||
} | ||
@@ -153,3 +155,3 @@ triggerUpdate () { | ||
// Need to re-initialize new widget type | ||
widget.teardown() | ||
widget.detach() | ||
needsReInit = true | ||
@@ -156,0 +158,0 @@ } |
@@ -42,4 +42,2 @@ import _ from '../util/lodash' | ||
} | ||
teardown () { | ||
} | ||
routeChange (type, payload) { | ||
@@ -46,0 +44,0 @@ switch (type) { |
@@ -13,2 +13,3 @@ import chai from 'chai' | ||
import './plugins/widget' | ||
import './plugins/widget-iframe' | ||
import './schema/block-meta' |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
7512394
159
15350
+ Added@the-grid/ced@0.1.3(transitive)
+ Added@the-grid/ed-userhtml@0.3.0(transitive)
+ Addedimgflo-url@1.2.0(transitive)
+ Addedlodash@4.17.4(transitive)
+ Addedreact@15.4.2(transitive)
+ Addedreact-dom@15.4.2(transitive)
+ Addeduuid@3.0.1(transitive)
- Removed@the-grid/ced@0.1.2(transitive)
- Removed@the-grid/ed-userhtml@0.2.1(transitive)
- Removedhe@0.5.0(transitive)
- Removedimgflo-url@1.1.0(transitive)
- Removedlodash@4.14.1(transitive)
- Removedreact@15.3.1(transitive)
- Removedreact-dom@15.3.1(transitive)
- Removeduuid@2.0.2(transitive)
Updated@the-grid/ced@0.1.3
Updated@the-grid/ed-userhtml@0.3.0
Updatedimgflo-url@1.2.0
Updatedlodash@4.17.4
Updatedreact@15.4.2
Updatedreact-dom@15.4.2
Updateduuid@3.0.1