-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored fixedMenuItem and fixed linting
- Loading branch information
Showing
15 changed files
with
99 additions
and
50 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
define(function() { | ||
'use strict'; | ||
|
||
var FixedMenuItem = Backbone.Model.extend({ | ||
defaults: { | ||
text: '' | ||
} | ||
}); | ||
|
||
return FixedMenuItem; | ||
}); |
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,16 @@ | ||
define(function(require) { | ||
'use strict'; | ||
|
||
var MenuItemTemplate = require('text!template/element/menuItem.html'); | ||
|
||
var FixedMenuItemView = Marionette.ItemView.extend({ | ||
className: 'listItem listItem--small listItem--clickable listItem--selectable u-bordered--top', | ||
template: _.template(MenuItemTemplate), | ||
|
||
triggers: { | ||
'click': 'click:fixedMenuItem' | ||
} | ||
}); | ||
|
||
return FixedMenuItemView; | ||
}); |
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
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
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
27 changes: 27 additions & 0 deletions
27
src/js/test/foreground/view/element/fixedMenuItemView.spec.js
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,27 @@ | ||
define(function(require) { | ||
'use strict'; | ||
|
||
var FixedMenuItemView = require('foreground/view/element/fixedMenuItemView'); | ||
var FixedMenuItem = require('foreground/model/fixedMenuItem'); | ||
|
||
describe('FixedMenuItemView', function() { | ||
beforeEach(function() { | ||
this.documentFragment = document.createDocumentFragment(); | ||
this.fixedMenuItemView = new FixedMenuItemView({ | ||
model: new FixedMenuItem() | ||
}); | ||
}); | ||
|
||
afterEach(function() { | ||
this.fixedMenuItemView.destroy(); | ||
}); | ||
|
||
it('should be able to find all referenced ui targets', function() { | ||
this.documentFragment.appendChild(this.fixedMenuItemView.render().el); | ||
|
||
_.forIn(this.fixedMenuItemView.ui, function(element) { | ||
expect(element.length).to.not.equal(0); | ||
}); | ||
}); | ||
}); | ||
}); |
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
File renamed without changes.
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,13 +1,4 @@ | ||
<div data-ui='panelContent' class='menu-items panel-content panel-content--uncolored panel-content--fadeInOut'> | ||
<div data-region='simpleMenuItems'></div> | ||
|
||
<% if(fixedMenuItemTitle !== '') { %> | ||
<div data-ui='fixedMenuItem' class='listItem listItem--small listItem--clickable listItem--selectable u-bordered--top'> | ||
<div class='listItem-content'> | ||
<div class='listItem-title'> | ||
<%- fixedMenuItemTitle %> | ||
</div> | ||
</div> | ||
</div> | ||
<% } %> | ||
<div data-region='fixedMenuItem'></div> | ||
</div> |