Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Commit

Permalink
Merge pull request #81 from Shurakai/dropdown
Browse files Browse the repository at this point in the history
Dropdown
  • Loading branch information
xsokev committed Apr 25, 2014
2 parents b0bf98b + 32a65e4 commit 1de4144
Showing 1 changed file with 29 additions and 18 deletions.
47 changes: 29 additions & 18 deletions Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,28 +46,40 @@ define([
// selected. Returns event.selectedItem.
//
// example:
// | <input value="21-12-2012" class="date" type="text"
// | data-dojo-type="Datepicker" data-dojo-props="format:'dd-M-yyyy'">
// | <span id="dd1" class="dropdown" data-dojo-type="bootstrap/Dropdown">
// | <a class="dropdown-toggle" href="#">Dropdown <b class="caret"></b></a>
// | <ul class="dropdown-menu" role="menu">
// | <li><a href="http://google.com">one</a></li>
// | <li><a href="#">two</a></li>
// | <li><a href="#">three</a></li>
// | </ul>
// | </span>
// example:
// | <div class="input-append" id="mydate">
// | <input value="21-12-2012" class="date" type="text" />
// | <span class="add-on"><i class="icon-th"></i></span>
// | </div>
// | new Datepicker({
// | format:'dd-M-yyyy',
// | selector: '.add-on',
// | trigger: 'click'
// | }, dojo.byId("#mydate"));
// example:
// | <button class="btn" id="dateBtn">...</button>
// | new Datepicker({
// | trigger: 'click'
// | }, dojo.byId("#dateBtn"));
// | <span id="dd1" class="dropdown">
// | <a class="dropdown-toggle" href="#">Dropdown <b class="caret"></b></a>
// | <ul class="dropdown-menu" role="menu">
// | <li><a href="http://google.com">one</a></li>
// | <li><a href="#">two</a></li>
// | <li><a href="#">three</a></li>
// | </ul>
// | </span>
// |
// | require(["dojo/query"], function(query) {
// | new Dropdown({
// | preventDefault: false,
// | selectable: true,
// | selectFirstOnOpen: false
// | }, query("#dd1")[0]);
// | });

// preventDefault: Boolean
// prevent default actions when list items are clicked
preventDefault: false,
// selectable: Boolean
selectable: true,
// selectFirstOnOpen: Boolean
// If true, the first list element will be marked as active
// by adding the css-class "active" to the element.
selectFirstOnOpen: false,

postCreate: function () {
Expand Down Expand Up @@ -152,7 +164,6 @@ define([
}
this.shown = true;
this.list.domNode.focus();

},

close: function () {
Expand Down Expand Up @@ -198,4 +209,4 @@ define([
});

return _Dropdown;
});
});

0 comments on commit 1de4144

Please sign in to comment.