[Edit] Update EditToolbar spec

Update EditToolbar spec to reflect changes for WTD-881.
This commit is contained in:
Victor Woeltjen
2015-02-23 19:47:56 -08:00
parent 5ee0f9372b
commit 307fbe2151
2 changed files with 58 additions and 81 deletions

View File

@ -16,7 +16,6 @@ define(
* the current selection.
*
* @param structure toolbar structure, as provided by view definition
* @param {Array} selection the current selection state
* @param {Function} commit callback to invoke after changes
* @constructor
*/
@ -109,7 +108,7 @@ define(
function isApplicable(item) {
var property = (item || {}).property,
method = (item || {}).method,
exclusive = (item || {}).exclusive;
exclusive = !!(item || {}).exclusive;
// Check if a selected item defines this property
function hasProperty(selected) {
@ -151,11 +150,6 @@ define(
return converted;
}
// Used to filter out sections that have become empty
function nonEmpty(section) {
return section && section.items && section.items.length > 0;
}
// Prepare a toolbar section
function convertSection(section) {
var converted = Object.create(section || {});
@ -188,9 +182,7 @@ define(
}
toolbarStructure.sections =
((structure || {}).sections || [])
.map(convertSection)
.filter(nonEmpty);
((structure || {}).sections || []).map(convertSection);
toolbarState = [];