Created
March 3, 2011 12:59
-
-
Save davidpadbury/852716 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; $(function (mstats, $) { | |
$.widget('mstats.fillupsPane', { | |
options: { | |
active: false, | |
id: null | |
}, | |
_init: function () { | |
mstats.fillupsPane = this; | |
mstats.pubsub.subscribe(mstats.events.vehicle.fillups.data, this._newFillupsDataHandler, this); | |
this._fetchData(); | |
}, | |
fetchData: function (vid) { | |
this.options.id = vid; | |
this._fetchData(); | |
}, | |
_fetchData: function () { | |
var vid = (this.options.id) ? '/' + this.options.id : ''; | |
mstats.dataManager.fetchData(mstats.endpoint.fillup.data + vid); | |
}, | |
// Large bulk of code excluded... | |
destroy: function () { | |
$.Widget.prototype.destroy.apply(this, arguments); // default destroy | |
mstats.pubsub.unsubscribe(mstats.events.vehicle.fillups.data, this._newFillupsDataHandler, this); | |
} | |
}); | |
} (this.mstats = this.mstats || {}, jQuery)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment