Skip to content

Commit

Permalink
Remove component init hook
Browse files Browse the repository at this point in the history
Remove component `ready` hook
  • Loading branch information
janschoenherr committed Sep 25, 2018
1 parent 297cf54 commit 612c26e
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 30 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -16,6 +16,8 @@
### Removed

- Remove `::-moz-selection` which is not needed anymore
- Remove component `init` hook
- Remove component `ready` hook

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion src/js/api/global.js
Expand Up @@ -70,7 +70,7 @@ export default function (UIkit) {
}

for (const name in data) {
if (data[name]._isReady) {
if (data[name]._connected) {
data[name]._callUpdate(e);
}
}
Expand Down
17 changes: 0 additions & 17 deletions src/js/api/hooks.js
Expand Up @@ -27,11 +27,6 @@ export default function (UIkit) {
this._initObserver();

this._callHook('connected');

if (!this._isReady) {
ready(() => this._callReady());
}

this._callUpdate();
};

Expand All @@ -55,18 +50,6 @@ export default function (UIkit) {

};

UIkit.prototype._callReady = function () {

if (this._isReady) {
return;
}

this._isReady = true;
this._callHook('ready');
this._resetComputeds();
this._callUpdate();
};

UIkit.prototype._callUpdate = function (e) {

e = createEvent(e || 'update');
Expand Down
2 changes: 0 additions & 2 deletions src/js/api/instance.js
Expand Up @@ -20,8 +20,6 @@ export default function (UIkit) {

this.$el = this.$options.el = this.$options.el || el;

this._callHook('init');

if (within(el, document)) {
this._callConnected();
}
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/notification.js
Expand Up @@ -37,7 +37,7 @@ export default {

},

ready() {
connected() {

const marginBottom = toFloat(css(this.$el, 'marginBottom'));
Transition.start(
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/sortable.js
Expand Up @@ -34,7 +34,7 @@ export default {
handle: false
},

init() {
created() {
['init', 'start', 'move', 'end'].forEach(key => {
const fn = this[key];
this[key] = e => {
Expand Down
2 changes: 2 additions & 0 deletions src/js/core/core.js
Expand Up @@ -4,6 +4,8 @@ export default function (UIkit) {

ready(() => {

UIkit.update();

let scroll = 0;
let started = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/js/core/drop.js
Expand Up @@ -49,7 +49,7 @@ export default {

},

init() {
created() {
this.tracker = new MouseTracker();
},

Expand Down
4 changes: 0 additions & 4 deletions src/js/core/video.js
Expand Up @@ -28,10 +28,6 @@ export default {
this.$el.preload = 'none';
}

},

ready() {

this.player = new Player(this.$el);

if (this.automute) {
Expand Down
2 changes: 1 addition & 1 deletion src/js/mixin/slider-drag.js
Expand Up @@ -7,7 +7,7 @@ export default {
preventCatch: false
},

init() {
created() {

['start', 'move', 'end'].forEach(key => {

Expand Down
2 changes: 0 additions & 2 deletions src/js/util/options.js
Expand Up @@ -5,11 +5,9 @@ const strats = {};
// concat strategy
strats.args =
strats.events =
strats.init =
strats.created =
strats.beforeConnect =
strats.connected =
strats.ready =
strats.beforeDisconnect =
strats.disconnected =
strats.destroy = function (parentVal, childVal) {
Expand Down

0 comments on commit 612c26e

Please sign in to comment.