mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 05:37:34 +03:00
2625199fb2
no issue The logic for "delete if empty" was duplicated in two places: 1. when `createComponentCard` is used to register a card, this option method was used when cleaning up a post when first rendering (cards in empty state can be saved before the editor auto-removes them but we don't want to show them again) 2. inside of card's own delete-if-empty handling on certain actions such as deselection or leaving edit mode - added an `ifEmpty` property to each card component - used by the editor's first-render cleanup routing if the property is present - can be re-used internally for the card's own deselect/exit-edit-mode behaviour - updated the cleanup routine in `<KoenigEditor>` - added a `allComponentCardsRegistered` property that will return `true` when the `.component` property is set on every card (the property is set during card component initialisation so we're at the mercy of Ember's render process so not all card components will be immediately registered) - swapped `_cleanup` for `_cleanupTask` that will wait for `allComponentCardsRegistered` to be `true` before performing cleanup, ensuring that we always have access to the card component's `isEmpty` property even when Ember renders cards across multiple render batches - checks for `isEmpty` being a boolean and will delete the card if it's value is `true` - updated all cards that had delete-if-empty behaviour - added `isEmpty` properties - removed duplicated logic in the `createComponentCard` calls |
||
---|---|---|
.. | ||
.github | ||
app | ||
config | ||
lib | ||
mirage | ||
public/assets | ||
tests | ||
.csscomb.json | ||
.editorconfig | ||
.ember-cli | ||
.eslintignore | ||
.eslintrc.js | ||
.gitignore | ||
.watchmanconfig | ||
ember-cli-build.js | ||
ember-cli-update.json | ||
Gruntfile.js | ||
LICENSE | ||
package.json | ||
README.md | ||
renovate.json | ||
SECURITY.md | ||
testem.js | ||
yarn.lock |
Ghost-Admin
This is the home of Ember.js based admin client that ships with Ghost.
Do you want to set up a Ghost blog? Check the getting started guide
Do you want to modify or contribute to Ghost-Admin? Please read how to install from source and swing by our forum if you need any help 😄
Have a bug or issue?
Bugs and issues (even if they only affect the admin client) should be opened on the core Ghost repository.
Copyright & License
Copyright (c) 2013-2021 Ghost Foundation - Released under the MIT license. Ghost and the Ghost Logo are trademarks of Ghost Foundation Ltd. Please see our trademark policy for info on acceptable usage.