Created
January 25, 2013 18:18
-
-
Save VinSpee/4636634 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() { | |
define(["jquery"], function($) { | |
var Toggle; | |
Toggle = (function() { | |
function Toggle(context, toggle, toggler, togglable, callback) { | |
this.context = context; | |
this.$context = $(this.context); | |
this.$toggle = $(this.context).find(toggle); | |
this.$toggler = $(this.context).find(toggler); | |
this.$togglable = $(this.context).find(togglable); | |
this.callback = callback; | |
console.log(this.doToggle); | |
this.$toggler.on("click", this.doToggle(this.$togglable)); | |
console.log(this); | |
} | |
Toggle.prototype.doToggle = function(togglable) { | |
return console.log("clicked"); | |
}; | |
return Toggle; | |
})(); | |
return Toggle; | |
}); | |
}).call(this); |
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() { | |
define(["autocomplete", "duplicate-item", "toggler"], function(autocomplete, Filter, Toggler) { | |
return { | |
initialize: function() { | |
var resultsToggler; | |
return resultsToggler = new Toggler(".results", "[data-widget=toggle]", "[data-widget-component=toggler]", "[data-widget-component=togglable]"); | |
} | |
}; | |
}); | |
}).call(this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment