]>
git.r.bdr.sh - rbdr/r.bdr.sh/blob - jekyll/js/unlimited_pizza.js
2dc7a7c0001e6cc8bf446208a56abba182bbdce1
3 Class("UnlimitedPizza").inherits(Widget
)({
6 * Gets instance, creates it if not available.
8 instance : function getInstance(config
) {
9 if (!this._mainInstance
) {
10 this._mainInstance
= new this(config
);
12 return this._mainInstance
;
18 init : function (config
) {
19 Widget
.prototype.init
.call(this, config
)
21 this._bindInternalEvents();
24 _bindInternalEvents : function bindInternalEvents() {
25 this.bind('activate', this._onActivate
.bind(this));
28 _onActivate : function _activate() {
29 // If this is the first time activating it... then load
38 _load : function _load() {
40 // Melty cheese is our header image widget.
41 this._loadMeltyCheese();
44 _loadMeltyCheese : function() {
45 this.element
.find('.post-image').each(function (i
, headerElement
) {
47 // Create and activate
48 this.appendChild(new UnlimitedPizza
.MeltyCheese({
49 element : $(headerElement
),
52 this['header-' + i
].activate();