Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// optional params
selectedTransition: null,
selectedClip: null,
// params
selectedQuantizations: [BAR_QUANTIZATION],
selectedQuantization: Ember.computed.reads('selectedQuantizations.firstObject'),
mixVisualActionReceiver: null,
store: Ember.inject.service(),
followPlayhead: false,
selectedAutomation: CONTROL_TYPE_VOLUME,
newTrackPosition: null,
_playpauseMix: Ember.on(keyDown('Space'), makeKeybinding(function(e) {
this.send('playpause');
})),
_exitTransitionOnEscape: Ember.on(keyDown('Escape'), makeKeybinding(function(e) {
this.send('selectTransition', null);
})),
_pauseMix: Ember.on('willDestroyElement', function() {
this.send('pause');
}),
// repeatedely save mix, if any unsaved changes
// _autoSaveMix: Ember.on('init', function() {
// if (!this.get('isDestroyed')) {
// const mix = this.get('mix');
didInsertElement() {
this._super(...arguments);
this.on(keyDown('ArrowLeft'), makeEventHandler(-1));
this.on(keyDown('ArrowRight'), makeEventHandler(1));
this.on(keyDown('shift+ArrowLeft'), makeEventHandler(-10));
this.on(keyDown('shift+ArrowRight'), makeEventHandler(10));
this.on(keyDown('ctrl+shift+ArrowLeft'), makeEventHandler(-100));
this.on(keyDown('ctrl+shift+ArrowRight'), makeEventHandler(100));
this.on(keyUp('KeyR'), function() {
this.set('counter', 0);
});
this.on(keyPress('Digit5'), function() {
this.set('counter', 5);
});
}
import { on } from '@ember/object/evented';
import { set } from '@ember/object';
import ModalDialog from 'ember-modal-dialog/components/modal-dialog';
import {
EKMixin as EmberKeyboardMixin,
keyDown
} from 'ember-keyboard';
export default ModalDialog.extend(EmberKeyboardMixin, {
init() {
this._super(...arguments);
set(this, 'keyboardActivated', true);
},
closeOnEsc: on(keyDown('Escape'), function() {
this.sendAction('close');
})
});
import TextArea from '@ember/component/text-area';
import { on } from '@ember/object/evented';
import { EKMixin, EKOnFocusMixin, keyDown } from 'ember-keyboard';
export default TextArea.extend(EKMixin, EKOnFocusMixin, {
init() {
this._super(...arguments);
this.set('keyboardActivated', true);
},
customSubmit: on(keyDown('Enter+cmd'), function(e) {
e.preventDefault();
this.sendAction('modifiedSubmit');
})
});
export default Component.extend(EKMixin, {
layout,
docsRoutes: service(),
router: service(),
classNames: 'docs-viewer docs-flex docs-flex-1',
keyboardActivated: true,
willDestroyElement() {
this._super(...arguments);
this.get('docsRoutes').resetState();
},
nextPage: on(keyDown('KeyJ'), keyDown('ArrowRight'), function() {
if (!formElementHasFocus()) {
if (this.get('docsRoutes.next')) {
this.get('router').transitionTo(...this.get('docsRoutes.next.route'));
}
}
}),
previousPage: on(keyDown('KeyK'), keyDown('ArrowLeft'), function() {
if (!formElementHasFocus()) {
if (this.get('docsRoutes.previous')) {
this.get('router').transitionTo(...this.get('docsRoutes.previous.route'));
}
}
}),
});
keys.forEach((key) => {
this.on(keyDown(key), this._advanceText);
});
},
this.set('importFile');
this.set('model.importFileName');
});
});
});
},
_sortValues(a, b) {
return compare(a.toLowerCase(), b.toLowerCase());
},
activateKeyboard: on('init', function() {
this.set('keyboardActivated', true);
}),
updateListKeyboard: on(keyDown('ctrl+KeyS'), keyDown('cmd+KeyS'), function(event) {
this.send('updateList');
event.preventDefault();
}),
actions: {
addValue() {
this.send('openModal', 'admin.lookup.edit', EmberObject.create({
isNew: true
}));
},
confirmDeleteValue(value) {
let intl = this.get('intl');
let title = intl.t('admin.lookup.titles.deleteLookupValue');
let message = intl.t('messages.delete', { name: value });
this.displayConfirm(title, message, 'deleteValue', EmberObject.create({
valueToDelete: value
get(lxlContainer, 'keys').forEach((key) => {
lxlContainer.off(keyDown(key), lxlContainer._advanceText);
lxlContainer.on(keyDown(key), this, this._resolve);
});