codemirror-colorpicker
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -54,5 +54,4 @@ (function(mod) { | ||
function onPaste () { | ||
// TODO: cm 객체를 어디서 얻어오나? | ||
//self.style_color_update(); | ||
function onPaste (cm, evt) { | ||
onChange(cm, { origin : 'setValue'}); | ||
} | ||
@@ -109,4 +108,11 @@ | ||
this.cm.getWrapperElement().addEventListener('paste', onPaste); | ||
// create paste callback | ||
this.onPasteCallback = (function (cm, callback) { | ||
return function (evt) { | ||
callback.call(this, cm, evt); | ||
} | ||
})(this.cm, onPaste); | ||
this.cm.getWrapperElement().addEventListener('paste', this.onPasteCallback); | ||
if (this.is_edit_mode()) | ||
@@ -129,4 +135,10 @@ { | ||
this.cm.off('mousedown', onMousedown); | ||
this.cm.off('keyup', onKeyup); | ||
this.cm.off('change', onChange) | ||
this.cm.getWrapperElement().removeEventListener('paste', onPaste); | ||
this.cm.getWrapperElement().removeEventListener('paste', this.onPasteCallback); | ||
if (this.is_edit_mode()) | ||
{ | ||
this.cm.off('scroll'); | ||
} | ||
} | ||
@@ -133,0 +145,0 @@ |
{ | ||
"name": "codemirror-colorpicker", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "colorpicker for codemirror", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
122267
1497