2015-02-13 07:22:32 +03:00
|
|
|
import Ember from 'ember';
|
2014-05-31 04:07:15 +04:00
|
|
|
/*
|
2014-09-28 19:39:25 +04:00
|
|
|
Dropdowns and their buttons are evented and do not propagate clicks.
|
2014-05-31 04:07:15 +04:00
|
|
|
*/
|
2014-09-28 19:39:25 +04:00
|
|
|
var DropdownMixin = Ember.Mixin.create(Ember.Evented, {
|
2014-09-24 17:36:20 +04:00
|
|
|
classNameBindings: ['isOpen:open:closed'],
|
2014-08-06 18:32:10 +04:00
|
|
|
isOpen: false,
|
2014-10-25 01:09:50 +04:00
|
|
|
|
2014-05-31 04:07:15 +04:00
|
|
|
click: function (event) {
|
|
|
|
this._super(event);
|
2014-10-25 01:09:50 +04:00
|
|
|
|
2014-05-31 04:07:15 +04:00
|
|
|
return event.stopPropagation();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2014-10-25 01:09:50 +04:00
|
|
|
export default DropdownMixin;
|