Skip to content

Commit

Permalink
Keyboard shortcut: use 'd' to hide or show cards details (in collecti…
Browse files Browse the repository at this point in the history
…on atm)
  • Loading branch information
vindarel committed Apr 28, 2016
1 parent 583316e commit e7aa710
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"c3": "latest",
"angular-smart-table": "2.1",
"angular-loading-bar": "0.8",
"angular-datatables": "0.5"
"angular-datatables": "0.5",
"angular-hotkeys": "chieffancypants/angular-hotkeys#1.7.0"
},

"description": "abelujo",
Expand Down
1 change: 1 addition & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ var vendorJsFiles = [
'static/bower_components/angular-smart-table/dist/smart-table.min.js',
'static/bower_components/angular-datatables/dist/angular-datatables.min.js',
'static/bower_components/angular-loading-bar/build/loading-bar.min.js',
'static/bower_components/angular-hotkeys/build/hotkeys.min.js',
];

var appFiles = [
Expand Down
1 change: 1 addition & 0 deletions static/js/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ angular.module('abelujo', [
'smart-table',
'datatables',
'angular-loading-bar',
'cfp.hotkeys',

// application level:
'abelujo.filters',
Expand Down
12 changes: 11 additions & 1 deletion static/js/app/controllers/collectionController.ls
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
angular.module "abelujo.controllers", [] .controller 'collectionController', ['$http', '$scope', '$timeout', 'utils', '$filter', '$window', '$cookies', '$uibModal', '$log', ($http, $scope, $timeout, utils, $filter, $window, $cookies, $uibModal, $log) !->
angular.module "abelujo.controllers", [] .controller 'collectionController', ['$http', '$scope', '$timeout', 'utils', '$filter', '$window', '$cookies', '$uibModal', '$log', 'hotkeys', ($http, $scope, $timeout, utils, $filter, $window, $cookies, $uibModal, $log, hotkeys) !->
# utils: in services.js

# set the xsrf token via cookies.
Expand Down Expand Up @@ -136,6 +136,16 @@ angular.module "abelujo.controllers", [] .controller 'collectionController', ['$
$scope.alerts = alerts
, !->
$log.info "modal dismissed"


# Keyboard shortcuts (hotkeys)
hotkeys.bindTo($scope)
.add do
combo: "d"
description: gettext "show or hide the book details in tables."
callback: !->
$scope.toggle_images!

]

angular.module "abelujo" .controller "CollectionModalControllerInstance", ($http, $scope, $uibModalInstance, $window, $log, utils, selected) ->
Expand Down

0 comments on commit e7aa710

Please sign in to comment.