Skip to content

Commit

Permalink
fix issue #6
Browse files Browse the repository at this point in the history
  • Loading branch information
dolymood committed Nov 28, 2017
1 parent 91741a6 commit 422952f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/picker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function Picker (options, config) {

this.lang = options.lang || 'EN'
this.lang = options.lang
this.destroyed = false
var defConfig = DEFCONFIG[this.lang]
if (!defConfig) {
defConfig = DEFCONFIG['EN']
Expand Down Expand Up @@ -301,13 +302,17 @@ utils.extend(pickerPro, {
this._removeEvt(EVENT_CANCEL)
},
destroy: function () {
if (this.destroyed) {
return
}
this.trigger('destroy')
this.hide()
this.desEvts()
this.container.removeChild(this.rootEle)
this.dateTime.destroy()
this.panel && this.panel.destroy()
utils.set2Null(['container', 'rootEle', 'ele', 'head', 'content', 'foot', 'dateTime', 'panel', 'config', 'lang'], this)
this.destroyed = true
}
}, events)

Expand Down

0 comments on commit 422952f

Please sign in to comment.