mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-19 08:31:43 +03:00
a9608d77ae
Previously, the exports were somewhat random with some files declaring local variables then immediately exporting them, and others simply doing the work needed in the export itself.
29 lines
903 B
JavaScript
29 lines
903 B
JavaScript
import BodyEventListener from 'ghost/mixins/body-event-listener';
|
|
|
|
var PopoverService = Ember.Object.extend(Ember.Evented, BodyEventListener, {
|
|
bodyClick: function (event) {
|
|
/*jshint unused:false */
|
|
this.closePopovers();
|
|
},
|
|
closePopovers: function () {
|
|
this.trigger('close');
|
|
},
|
|
togglePopover: function (popoverName) {
|
|
this.trigger('toggle', {target: popoverName});
|
|
}
|
|
});
|
|
|
|
var popoverInitializer = {
|
|
name: 'popover',
|
|
|
|
initialize: function (container, application) {
|
|
application.register('popover:service', PopoverService);
|
|
|
|
application.inject('component:gh-popover', 'popover', 'popover:service');
|
|
application.inject('component:gh-popover-button', 'popover', 'popover:service');
|
|
application.inject('controller:modals.delete-post', 'popover', 'popover:service');
|
|
}
|
|
};
|
|
|
|
export default popoverInitializer;
|