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:
@@ -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();
|
||||
},
|
||||
|
||||
|
21
ember/app/components/dropdown-button.js
Normal file
21
ember/app/components/dropdown-button.js
Normal 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')
|
||||
});
|
24
ember/app/components/dropdown-split.js
Normal file
24
ember/app/components/dropdown-split.js
Normal 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')
|
||||
});
|
@@ -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'),
|
||||
});
|
Reference in New Issue
Block a user