Merge branch 'master' into vdom
This commit is contained in:
commit
ecca7b69bb
12
Gemfile.lock
12
Gemfile.lock
|
@ -328,9 +328,9 @@ GEM
|
||||||
sass (3.2.19)
|
sass (3.2.19)
|
||||||
sass-rails (4.0.5)
|
sass-rails (4.0.5)
|
||||||
railties (>= 4.0.0, < 5.0)
|
railties (>= 4.0.0, < 5.0)
|
||||||
sass (~> 3.2.0)
|
sass (~> 3.2.2)
|
||||||
sprockets (~> 2.8, <= 2.11.0)
|
sprockets (~> 2.8, < 3.0)
|
||||||
sprockets-rails (~> 2.0.0)
|
sprockets-rails (~> 2.0)
|
||||||
seed-fu (2.3.5)
|
seed-fu (2.3.5)
|
||||||
activerecord (>= 3.1, < 4.3)
|
activerecord (>= 3.1, < 4.3)
|
||||||
activesupport (>= 3.1, < 4.3)
|
activesupport (>= 3.1, < 4.3)
|
||||||
|
@ -362,15 +362,15 @@ GEM
|
||||||
spork-rails (4.0.0)
|
spork-rails (4.0.0)
|
||||||
rails (>= 3.0.0, < 5)
|
rails (>= 3.0.0, < 5)
|
||||||
spork (>= 1.0rc0)
|
spork (>= 1.0rc0)
|
||||||
sprockets (2.11.0)
|
sprockets (2.12.4)
|
||||||
hike (~> 1.2)
|
hike (~> 1.2)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
rack (~> 1.0)
|
rack (~> 1.0)
|
||||||
tilt (~> 1.1, != 1.3.0)
|
tilt (~> 1.1, != 1.3.0)
|
||||||
sprockets-rails (2.0.1)
|
sprockets-rails (2.3.3)
|
||||||
actionpack (>= 3.0)
|
actionpack (>= 3.0)
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 3.0)
|
||||||
sprockets (~> 2.8)
|
sprockets (>= 2.8, < 4.0)
|
||||||
stackprof (0.2.7)
|
stackprof (0.2.7)
|
||||||
therubyracer (0.12.2)
|
therubyracer (0.12.2)
|
||||||
libv8 (~> 3.16.14.0)
|
libv8 (~> 3.16.14.0)
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
|
import { on, observes } from 'ember-addons/ember-computed-decorators';
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
|
|
||||||
_init: function(){
|
@on('init')
|
||||||
|
_init() {
|
||||||
if (!this.get('site.mobileView')) {
|
if (!this.get('site.mobileView')) {
|
||||||
var classes = this.get('desktopClass');
|
var classes = this.get('desktopClass');
|
||||||
if (classes) {
|
if (classes) {
|
||||||
|
@ -8,16 +11,17 @@ export default Ember.Component.extend({
|
||||||
this.set('classNames', classes);
|
this.set('classNames', classes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.on('init'),
|
},
|
||||||
|
|
||||||
tagName: 'ul',
|
tagName: 'ul',
|
||||||
|
|
||||||
classNames: ['mobile-nav'],
|
classNames: ['mobile-nav'],
|
||||||
|
|
||||||
currentPathChanged: function(){
|
@observes('currentPath')
|
||||||
|
currentPathChanged() {
|
||||||
this.set('expanded', false);
|
this.set('expanded', false);
|
||||||
Em.run.next(() => this._updateSelectedHtml());
|
Em.run.next(() => this._updateSelectedHtml());
|
||||||
}.observes('currentPath'),
|
},
|
||||||
|
|
||||||
_updateSelectedHtml(){
|
_updateSelectedHtml(){
|
||||||
const active = this.$('.active');
|
const active = this.$('.active');
|
||||||
|
@ -26,10 +30,22 @@ export default Ember.Component.extend({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
didInsertElement(){
|
didInsertElement() {
|
||||||
this._updateSelectedHtml();
|
this._updateSelectedHtml();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@on('didInsertElement')
|
||||||
|
_bindClick() {
|
||||||
|
this.$().on("click.mobile-nav", 'ul li', () => {
|
||||||
|
this.set('expanded', false);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
@on('willDestroyElement')
|
||||||
|
_unbindClick() {
|
||||||
|
this.$().off("click.mobile-nav", 'ul li');
|
||||||
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
toggleExpanded(){
|
toggleExpanded(){
|
||||||
this.toggleProperty('expanded');
|
this.toggleProperty('expanded');
|
||||||
|
|
|
@ -21,13 +21,7 @@ const HeaderController = Ember.Controller.extend({
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
toggleSearch() {
|
toggleSearch() {
|
||||||
// there may be a cleaner way, but this is so trivial code wise
|
this.toggleProperty('searchVisible');
|
||||||
const $fullpageSearch = $('input.full-page-search');
|
|
||||||
if ($fullpageSearch.length === 1) {
|
|
||||||
$fullpageSearch.focus().select();
|
|
||||||
} else {
|
|
||||||
this.toggleProperty('searchVisible');
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
showUserMenu() {
|
showUserMenu() {
|
||||||
if (!this.get('userMenuVisible')) {
|
if (!this.get('userMenuVisible')) {
|
||||||
|
|
Loading…
Reference in New Issue