backbone-toolbar
Advanced tools
Comparing version 0.0.5-0 to 0.0.5
@@ -191,10 +191,2 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
function defaultState() { | ||
return { | ||
items: [], | ||
classes: [], | ||
events: {} | ||
}; | ||
} | ||
function getItemContext(item) { | ||
@@ -295,3 +287,3 @@ if (!_underscore2.default.isString(item.type)) { | ||
value: function set(id, options) { | ||
var item = _underscore2.default.isFunction(options) ? options(this.get(id)) : item; | ||
var item = _underscore2.default.isFunction(options) ? options(this.get(id)) : options; | ||
@@ -1252,3 +1244,4 @@ this.update(_underscore2.default.defaults({ | ||
classes: [], | ||
id: _underscore2.default.uniqueId('dropdown-') | ||
id: _underscore2.default.uniqueId('dropdown-'), | ||
attributes: {} | ||
}); | ||
@@ -1270,3 +1263,3 @@ var html = (0, _dropdown2.default)(options); | ||
var jade_interp; | ||
;var locals_for_with = (locals || {});(function (button, classes, id, menu) { | ||
;var locals_for_with = (locals || {});(function (attributes, button, classes, id, menu) { | ||
jade_mixins["buttonMixin"] = jade_interp = function(options){ | ||
@@ -1313,6 +1306,6 @@ var block = (this && this.block), attributes = (this && this.attributes) || {}; | ||
}; | ||
buf.push("<div" + (jade.attr("id", id, true, true)) + (jade.cls(['dropdown',classes], [null,true])) + ">"); | ||
buf.push("<div" + (jade.attrs(jade.merge([{"id": jade.escape(id),"class": (jade_interp = [null,true], jade.joinClasses(['dropdown',classes].map(jade.joinClasses).map(function (cls, i) { return jade_interp[i] ? jade.escape(cls) : cls })))},attributes]), true)) + ">"); | ||
jade_mixins["buttonMixin"](button); | ||
jade_mixins["menuMixin"](button.id, menu); | ||
buf.push("</div>");}.call(this,"button" in locals_for_with?locals_for_with.button:typeof button!=="undefined"?button:undefined,"classes" in locals_for_with?locals_for_with.classes:typeof classes!=="undefined"?classes:undefined,"id" in locals_for_with?locals_for_with.id:typeof id!=="undefined"?id:undefined,"menu" in locals_for_with?locals_for_with.menu:typeof menu!=="undefined"?menu:undefined));;return buf.join(""); | ||
buf.push("</div>");}.call(this,"attributes" in locals_for_with?locals_for_with.attributes:typeof attributes!=="undefined"?attributes:undefined,"button" in locals_for_with?locals_for_with.button:typeof button!=="undefined"?button:undefined,"classes" in locals_for_with?locals_for_with.classes:typeof classes!=="undefined"?classes:undefined,"id" in locals_for_with?locals_for_with.id:typeof id!=="undefined"?id:undefined,"menu" in locals_for_with?locals_for_with.menu:typeof menu!=="undefined"?menu:undefined));;return buf.join(""); | ||
} | ||
@@ -1511,3 +1504,3 @@ | ||
function renderDropdownRadioGroup(item, renderItem) { | ||
function renderDropdownRadioGroup(item) { | ||
var dropdownRadioGroup = normalizeItem(item); | ||
@@ -1566,3 +1559,3 @@ var html = (0, _dropdownRadioGroup2.default)(dropdownRadioGroup); | ||
buf.push("<li role=\"presentation\"" + (jade.attr("data-value", item.value, true, true)) + " class=\"dropdown-radio-item\"><a role=\"menuitem\">"); | ||
buf.push("<li role=\"presentation\"" + (jade.attr("data-value", item.value, true, true)) + " class=\"dropdown-radio-item\"><span role=\"menuitem\">"); | ||
if ( item.value === value) | ||
@@ -1582,3 +1575,3 @@ { | ||
{ | ||
buf.push("<span class=\"pull-right remove-text\">" + (jade.escape(null == (jade_interp = removeText) ? "" : jade_interp)) + "</span>"); | ||
buf.push("<a class=\"pull-right remove-text\">" + (jade.escape(null == (jade_interp = removeText) ? "" : jade_interp)) + "</a>"); | ||
} | ||
@@ -1591,3 +1584,3 @@ if ( removeIcon) | ||
} | ||
buf.push("</a></li>"); | ||
buf.push("</span></li>"); | ||
} | ||
@@ -1600,3 +1593,3 @@ | ||
buf.push("<li role=\"presentation\"" + (jade.attr("data-value", item.value, true, true)) + " class=\"dropdown-radio-item\"><a role=\"menuitem\">"); | ||
buf.push("<li role=\"presentation\"" + (jade.attr("data-value", item.value, true, true)) + " class=\"dropdown-radio-item\"><span role=\"menuitem\">"); | ||
if ( item.value === value) | ||
@@ -1616,3 +1609,3 @@ { | ||
{ | ||
buf.push("<span class=\"pull-right remove-text\">" + (jade.escape(null == (jade_interp = removeText) ? "" : jade_interp)) + "</span>"); | ||
buf.push("<a class=\"pull-right remove-text\">" + (jade.escape(null == (jade_interp = removeText) ? "" : jade_interp)) + "</a>"); | ||
} | ||
@@ -1625,3 +1618,3 @@ if ( removeIcon) | ||
} | ||
buf.push("</a></li>"); | ||
buf.push("</span></li>"); | ||
} | ||
@@ -1670,3 +1663,3 @@ | ||
// module | ||
exports.push([module.id, ".toolbar .dropdown-radio-group > .dropdown-menu.dropdown-menu-group {\n display: block;\n position: static;\n left: 0;\n width: 100%;\n margin: 0;\n padding: 0;\n border: none;\n box-shadow: none;\n}\n.toolbar .dropdown-radio-group > .dropdown-menu.dropdown-menu-group span.selection {\n visibility: hidden;\n margin-right: 5px;\n}\n.toolbar .dropdown-radio-group > .dropdown-menu.dropdown-menu-group span.selection.selection-selected {\n visibility: visible;\n}\n", ""]); | ||
exports.push([module.id, ".toolbar .dropdown-radio-group > .dropdown-menu.dropdown-menu-group {\n display: block;\n position: static;\n left: 0;\n width: 100%;\n margin: 0;\n padding: 0;\n border: none;\n box-shadow: none;\n}\n.toolbar .dropdown-radio-group > .dropdown-menu.dropdown-menu-group li.dropdown-radio-item {\n cursor: pointer;\n}\n.toolbar .dropdown-radio-group > .dropdown-menu.dropdown-menu-group span.selection {\n visibility: hidden;\n margin-right: 5px;\n}\n.toolbar .dropdown-radio-group > .dropdown-menu.dropdown-menu-group span.selection.selection-selected {\n visibility: visible;\n}\n", ""]); | ||
@@ -1742,22 +1735,10 @@ // exports | ||
var html = (0, _dropdownSubmenu2.default)(options); | ||
var selector = 'li#' + options.id; | ||
events['click #' + options.button.id] = function (e) { | ||
var $menu = this.$('#' + options.menu.id); | ||
var hideMenu = function hideMenu() { | ||
$menu.hide(); | ||
(0, _jquery2.default)(document).off('click', hideMenu); | ||
}; | ||
var showMenu = function showMenu() { | ||
$menu.show(); | ||
(0, _jquery2.default)(document).on('click', hideMenu); | ||
}; | ||
events['mouseover ' + selector] = function () { | ||
this.$('#' + options.menu.id).show(); | ||
}; | ||
if ($menu.is(':visible')) { | ||
hideMenu(); | ||
} else { | ||
showMenu(); | ||
} | ||
e.stopPropagation(); | ||
e.preventDefault(); | ||
events['mouseover ul:has(> ' + selector + ') > li:not(' + selector + ')'] = function (e) { | ||
this.$('#' + options.menu.id).hide(); | ||
}; | ||
@@ -1764,0 +1745,0 @@ |
{ | ||
"main": "dist/backbone-toolbar.js", | ||
"version": "0.0.5-0", | ||
"version": "0.0.5", | ||
"files": [ | ||
@@ -5,0 +5,0 @@ "dist" |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
136575
1525