Commit b83f46393c7490924a580f01929817aed96a8e48
1 parent
61e46d4d43
Exists in
master
and in
1 other branch
only listen for c outside of the model
Showing 3 changed files with 12 additions and 11 deletions Side-by-side Diff
scripts/FeedController.js
View file @
b83f463
... | ... | @@ -36,6 +36,7 @@ |
36 | 36 | console.log('pushed a card!'); |
37 | 37 | $scope.cards.push(myCard); // Add right away |
38 | 38 | $scope.refreshCards(); // Refresh list |
39 | + listenForC = true; | |
39 | 40 | }). |
40 | 41 | error(function (error) { |
41 | 42 | console.log('haha, n00b'); |
42 | 43 | |
43 | 44 | |
44 | 45 | |
... | ... | @@ -55,17 +56,18 @@ |
55 | 56 | console.log('refresh fail'); |
56 | 57 | }); |
57 | 58 | } |
58 | - | |
59 | + var listenForC = true; | |
59 | 60 | $(document).keydown(function (e) { |
60 | 61 | var keyed = e.which; |
61 | - if (keyed == 67) { // "c" or "C" for compose | |
62 | + if (keyed == 67 && listenForC) { // "c" or "C" for compose | |
62 | 63 | $('#newCard').openModal(); |
64 | + listenForC = false; | |
65 | + return false; | |
63 | 66 | } |
64 | 67 | }); |
65 | 68 | |
66 | 69 | |
67 | - $scope.flashcard = 'hi i am a flashcard. I need to be really long and awesome I ain\'t ' + | |
68 | - 'know how long I am right now. Is it good enough now?????????? Howz about now???'; | |
70 | + $scope.flashcard = ''; | |
69 | 71 | $scope.text = ''; |
70 | 72 | |
71 | 73 | $(document).ready(function () { |
... | ... | @@ -75,11 +77,6 @@ |
75 | 77 | opacity: 0, // Opacity of modal background |
76 | 78 | in_duration: 300, // Transition in duration |
77 | 79 | out_duration: 200, // Transition out duration |
78 | - ready: function () { | |
79 | - $('input:text:visible:first').focus(); | |
80 | - }, | |
81 | - complete: function () { | |
82 | - } // Callback for Modal close*/ | |
83 | 80 | } |
84 | 81 | ); |
85 | 82 | }); |
templates/login.html
View file @
b83f463
... | ... | @@ -20,7 +20,7 @@ |
20 | 20 | </div> |
21 | 21 | |
22 | 22 | <div class="input-field"> |
23 | - <input id="email" type="email" name="login" class="validate" ng-model="loginEmail" required/> | |
23 | + <input id="email" type="email" name="login" class="validate" ng-model="loginEmail" required autofocus autocomplete/> | |
24 | 24 | <label for="email">Email</label> |
25 | 25 | </div> |
26 | 26 | <div class="input-field"> |
templates/logout.html
View file @
b83f463