Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Keyboard ctrl-S or cmd-S is same as clicking Update button #665

Merged
merged 2 commits into from
Sep 24, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions app/admin/lookup/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import ImagingPricingTypes from 'hospitalrun/mixins/imaging-pricing-types';
import InventoryTypeList from 'hospitalrun/mixins/inventory-type-list';
import UnitTypes from 'hospitalrun/mixins/unit-types';
import VisitTypes from 'hospitalrun/mixins/visit-types';
export default Ember.Controller.extend(BillingCategories, LabPricingTypes,
ModalHelper, ImagingPricingTypes, InventoryTypeList, UnitTypes, VisitTypes, {
import { EKMixin, keyDown } from 'ember-keyboard';
export default Ember.Controller.extend(BillingCategories, EKMixin,
ImagingPricingTypes, InventoryTypeList, LabPricingTypes, ModalHelper,
UnitTypes, VisitTypes, {
fileSystem: Ember.inject.service('filesystem'),
lookupTypes: Ember.computed(function() {
return [{
Expand Down Expand Up @@ -311,6 +313,15 @@ export default Ember.Controller.extend(BillingCategories, LabPricingTypes,
return Ember.compare(a.toLowerCase(), b.toLowerCase());
},

activateKeyboard: Ember.on('init', function() {
this.set('keyboardActivated', true);
}),

updateListKeyboard: Ember.on(keyDown('ctrl+KeyS'), keyDown('cmd+KeyS'), function(event) {
this.send('updateList');
event.preventDefault();
}),

actions: {
addValue: function() {
this.send('openModal', 'admin.lookup.edit', Ember.Object.create({
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"ember-data": "~2.6.2",
"ember-export-application-global": "^1.0.5",
"ember-i18n": "4.3.2",
"ember-keyboard": "2.1.3",
"ember-load-initializers": "^0.5.1",
"ember-pouch": "4.0.1",
"ember-radio-buttons": "^4.0.1",
Expand Down