mirror of
https://github.com/documize/community.git
synced 2025-07-24 15:49:44 +02:00
[WIP] Upgrade EmberJS -- lint pass!
This commit is contained in:
parent
c7808d0b5a
commit
adbd00bdd7
95 changed files with 645 additions and 645 deletions
|
@ -12,7 +12,7 @@
|
|||
import $ from 'jquery';
|
||||
import { empty } from '@ember/object/computed';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { computed } from '@ember/object';
|
||||
import { computed, observer } from '@ember/object';
|
||||
import Notifier from '../../mixins/notifier';
|
||||
import Modals from '../../mixins/modal';
|
||||
import Component from '@ember/component';
|
||||
|
@ -33,7 +33,7 @@ export default Component.extend(Notifier, Modals, {
|
|||
return this.get('blocks.length') > 0;
|
||||
}),
|
||||
|
||||
onModalToggle: function () {
|
||||
onModalToggle: observer('show', function() {
|
||||
let modalId = this.get('modalId');
|
||||
|
||||
if (this.get('show')) {
|
||||
|
@ -48,7 +48,7 @@ export default Component.extend(Notifier, Modals, {
|
|||
$(modalId).modal('hide');
|
||||
$(modalId).modal('dispose');
|
||||
}
|
||||
}.observes('show'),
|
||||
}),
|
||||
|
||||
addSection(model) {
|
||||
this.modalClose(this.get('modalId'));
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
// https://documize.com
|
||||
|
||||
import { debounce } from '@ember/runloop';
|
||||
import { computed, set } from '@ember/object';
|
||||
import { computed, set, observer } from '@ember/object';
|
||||
import { inject as service } from '@ember/service';
|
||||
import stringUtil from '../../utils/string';
|
||||
import ModalMixin from '../../mixins/modal';
|
||||
|
@ -35,7 +35,7 @@ export default Component.extend(ModalMixin, {
|
|||
}),
|
||||
modalId: computed('page', function() { return '#content-linker-modal-' + this.get('page.id'); }),
|
||||
showModal: false,
|
||||
onToggle: function() {
|
||||
onToggle: observer('showModal', function() {
|
||||
let modalId = this.get('modalId');
|
||||
|
||||
if (!this.get('showModal')) {
|
||||
|
@ -55,7 +55,7 @@ export default Component.extend(ModalMixin, {
|
|||
});
|
||||
|
||||
this.modalOpen(modalId, {show: true});
|
||||
}.observes('showModal'),
|
||||
}),
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
|
@ -77,9 +77,9 @@ export default Component.extend(ModalMixin, {
|
|||
this.modalClose(this.get('modalId'));
|
||||
},
|
||||
|
||||
onKeywordChange: function() {
|
||||
onKeywordChange: observer('keywords', function() {
|
||||
debounce(this, this.fetch, 750);
|
||||
}.observes('keywords'),
|
||||
}),
|
||||
|
||||
fetch() {
|
||||
let keywords = this.get('keywords');
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
// https://documize.com
|
||||
|
||||
import $ from 'jquery';
|
||||
import { computed } from '@ember/object';
|
||||
import { computed, observer } from '@ember/object';
|
||||
import { debounce } from '@ember/runloop';
|
||||
import { inject as service } from '@ember/service';
|
||||
import ModalMixin from '../../mixins/modal';
|
||||
|
@ -28,9 +28,9 @@ export default Component.extend(ModalMixin, {
|
|||
canDelete: false,
|
||||
canMove: false,
|
||||
docSearchFilter: '',
|
||||
onKeywordChange: function () {
|
||||
onKeywordChange: observer('docSearchFilter', function() {
|
||||
debounce(this, this.searchDocs, 750);
|
||||
}.observes('docSearchFilter'),
|
||||
}),
|
||||
emptySearch: computed('docSearchResults', function() {
|
||||
return this.get('docSearchResults.length') === 0;
|
||||
}),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue