Created
January 21, 2013 16:10
-
-
Save ianhenrysmith/4587104 to your computer and use it in GitHub Desktop.
Bootstrap hamlc dropdown helper
This file contains hidden or 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
| .dropdown{ class: @options.class } | |
| %input.dropdown_target{ type: "text", name: @field, id: @field, value:"#{@value}"} | |
| %span.dropdown-toggle= @value | |
| %ul.dropdown-menu{ role:"menu"} | |
| - for opt in @values | |
| %li.dropdown_item{v: opt}= opt |
This file contains hidden or 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
| - vs = $("#values").val().split(" ") | |
| != @h.dropdown({values: vs, field: "type", value: @model.type, options: {}}) |
This file contains hidden or 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
| Once.Views.Posts ||= {} | |
| class Posts.BaseView extends Backbone.View | |
| helpers: | |
| dropdown: (options={}) => | |
| JST['backbone/templates/shared/dropdown'](options) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment