forked from TryGhost/Ghost
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Ember.inject instead of needs and initializers
No Issue - Switches to the newer style of dependency injection. - Instead of injection Controllers via "needs," use Ember.inject.controller(). - Get rid of initializers that were only injecting objects into various factories. Converts these objects into Ember.Service objects and declaratively inject them where needed via Ember.inject.service(). The added benefit to this is that it's no longer a mystery where these properties/methods come from and it's straightforward to inject them where needed.
- Loading branch information
Showing
61 changed files
with
377 additions
and
483 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import Ember from 'ember'; | ||
|
||
var blogUrl = Ember.Component.extend({ | ||
tagName: '' | ||
tagName: '', | ||
config: Ember.inject.service() | ||
}); | ||
|
||
export default blogUrl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import Ember from 'ember'; | ||
import DropdownMixin from 'ghost/mixins/dropdown-mixin'; | ||
|
||
var DropdownButton = Ember.Component.extend(DropdownMixin, { | ||
export default Ember.Component.extend(DropdownMixin, { | ||
tagName: 'button', | ||
attributeBindings: 'role', | ||
role: 'button', | ||
|
||
// matches with the dropdown this button toggles | ||
dropdownName: null, | ||
|
||
dropdown: Ember.inject.service(), | ||
|
||
// Notify dropdown service this dropdown should be toggled | ||
click: function (event) { | ||
this._super(event); | ||
this.get('dropdown').toggleDropdown(this.get('dropdownName'), this); | ||
} | ||
}); | ||
|
||
export default DropdownButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
import Ember from 'ember'; | ||
var NotificationsComponent = Ember.Component.extend({ | ||
|
||
export default Ember.Component.extend({ | ||
tagName: 'aside', | ||
classNames: 'gh-notifications', | ||
|
||
messages: Ember.computed.filter('notifications', function (notification) { | ||
notifications: Ember.inject.service(), | ||
|
||
messages: Ember.computed.filter('notifications.content', function (notification) { | ||
var displayStatus = (typeof notification.toJSON === 'function') ? | ||
notification.get('status') : notification.status; | ||
|
||
return displayStatus === 'passive'; | ||
}) | ||
}); | ||
|
||
export default NotificationsComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import Ember from 'ember'; | ||
import GhostDropdown from 'ghost/components/gh-dropdown'; | ||
|
||
var GhostPopover = GhostDropdown.extend({ | ||
classNames: 'ghost-popover' | ||
export default GhostDropdown.extend({ | ||
classNames: 'ghost-popover', | ||
dropdown: Ember.inject.service() | ||
}); | ||
|
||
export default GhostPopover; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
import Ember from 'ember'; | ||
var CopyHTMLController = Ember.Controller.extend({ | ||
|
||
export default Ember.Controller.extend({ | ||
generatedHTML: Ember.computed.alias('model.generatedHTML') | ||
|
||
}); | ||
|
||
export default CopyHTMLController; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.