forked from max-mapper/ViewKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d319b36
commit 01308f5
Showing
6 changed files
with
106 additions
and
66 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
COMPONENTS = navbar \ | ||
topnav \ | ||
bottomnav \ | ||
button \ | ||
actionbutton \ | ||
navbutton \ | ||
scrollarea | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* Expose `Button` | ||
*/ | ||
|
||
exports.Button = Button | ||
|
||
/** | ||
* Create a new `Button` | ||
*/ | ||
|
||
exports.button = function(options) { | ||
return new Button(options) | ||
} | ||
|
||
/** | ||
* Initialize a new `Button` | ||
*/ | ||
|
||
function Button(options) { | ||
events.EventEmitter.call(this) | ||
this.options = $.extend({}, this.options, options) | ||
// grab from current scope if available | ||
if (typeof template !== "undefined") this.template = template | ||
} | ||
|
||
/** | ||
* Inherit from EventEmitter | ||
*/ | ||
|
||
util.inherits(Button, events.EventEmitter) | ||
|
||
|
||
/** | ||
* Returns HTML representation of the button | ||
*/ | ||
|
||
Button.prototype.build = function() { | ||
return mustache.to_html(this.template, this.options) | ||
} |
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
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