1
0
mirror of https://github.com/flarum/core.git synced 2025-07-31 21:50:50 +02:00

Working on responsive dropdown menu components.

This commit is contained in:
Toby Zerner
2015-01-02 11:46:40 +10:30
parent 690174297d
commit 89c8f80f3f
10 changed files with 93 additions and 54 deletions

View File

@@ -10,7 +10,7 @@ export default Ember.View.extend(PostStreamMixin, {
@property templateName
@type String
*/
templateName: 'discussion-scrollbar',
templateName: 'components/discussion-scrollbar',
classNames: ['scrubber', 'discussion-scrubber'],
// An object which represents/ecapsulates the scrollbar.
@@ -28,7 +28,7 @@ export default Ember.View.extend(PostStreamMixin, {
windowWasResized: function(event) {
var view = event.data.view;
view.scrollbar.$.height($('#sidebar-content').height() + $('#sidebar-content').offset().top - view.scrollbar.$.offset().top - 80);
// view.scrollbar.$.height($('#sidebar-content').height() + $('#sidebar-content').offset().top - view.scrollbar.$.offset().top - 80);
view.scrollbar.update();
},

View File

@@ -0,0 +1,21 @@
import Ember from 'ember';
export default Ember.Component.extend({
items: null, // NamedContainerView/Menu
layoutName: 'components/dropdown-button',
classNames: ['dropdown', 'btn-group'],
classNameBindings: ['itemCountClass'],
title: 'Controls',
icon: 'ellipsis-v',
buttonClass: 'btn-default',
menuClass: 'pull-right',
dropdownMenuClass: function() {
return 'dropdown-menu '+this.get('menuClass');
}.property('menuClass'),
itemCountClass: function() {
return 'item-count-'+this.get('items.length');
}.property('items')
});

View File

@@ -0,0 +1,24 @@
import Ember from 'ember';
export default Ember.Component.extend({
items: null, // NamedContainerView/Menu
layoutName: 'components/dropdown-split',
classNames: ['dropdown', 'dropdown-split', 'btn-group'],
classNameBindings: ['itemCountClass'],
buttonClass: 'btn-default',
menuClass: 'pull-right',
icon: 'ellipsis-v',
mainButtonClass: function() {
return 'btn '+this.get('buttonClass');
}.property('buttonClass'),
dropdownMenuClass: function() {
return 'dropdown-menu '+this.get('menuClass');
}.property('menuClass'),
itemCountClass: function() {
return 'item-count-'+this.get('items.length');
}.property('items')
});

View File

@@ -1,15 +0,0 @@
import Ember from 'ember';
export default Ember.Component.extend({
items: null, // NamedContainerView/Menu
layoutName: 'components/menu-split',
show: 1,
visibleItems: function() {
return this.get('items').slice(0, this.get('show'));
}.property('items'),
hiddenItems: function() {
return this.get('items').slice(this.get('show'));
}.property('items'),
});