Commit 2ad496102fa63654009b86b0bb992904aad38f71
1 parent
0987fcfc86
Exists in
master
and in
1 other branch
Tweaking hotkey add and feed and css
Showing 3 changed files with 20 additions and 4 deletions Side-by-side Diff
scripts/FeedController.js
View file @
2ad4961
... | ... | @@ -56,6 +56,8 @@ |
56 | 56 | console.log('refresh fail'); |
57 | 57 | }); |
58 | 58 | } |
59 | + | |
60 | + /* Key bindings for the whole feed window. Hotkey it up! */ | |
59 | 61 | var listenForC = true; |
60 | 62 | $(document).keydown(function (e) { |
61 | 63 | var keyed = e.which; |
... | ... | @@ -63,6 +65,9 @@ |
63 | 65 | $('#newCard').openModal(); |
64 | 66 | listenForC = false; |
65 | 67 | return false; |
68 | + } else if (keyed == 13 || keyed == 27) { // enter or esc, respectively | |
69 | + listenForC = true; | |
70 | + document.getElementById('new-card-input').value = ''; | |
66 | 71 | } |
67 | 72 | }); |
68 | 73 | |
... | ... | @@ -77,6 +82,14 @@ |
77 | 82 | opacity: 0, // Opacity of modal background |
78 | 83 | in_duration: 300, // Transition in duration |
79 | 84 | out_duration: 200, // Transition out duration |
85 | + ready: function() { | |
86 | + listenForC = false; | |
87 | + console.log("modal OPENING"); | |
88 | + }, | |
89 | + complete: function() { | |
90 | + listenForC = true; | |
91 | + console.log("modal done, closing"); | |
92 | + } | |
80 | 93 | } |
81 | 94 | ); |
82 | 95 | }); |
styles/flashy.css
View file @
2ad4961
... | ... | @@ -104,7 +104,7 @@ |
104 | 104 | } |
105 | 105 | |
106 | 106 | .card:hover .card-overlay { |
107 | - opacity: 1; | |
107 | + opacity: 0.9; | |
108 | 108 | transition-delay: 0s; /* animation effect to appear on hover */ |
109 | 109 | visibility: visible; |
110 | 110 | } |
... | ... | @@ -166,7 +166,10 @@ |
166 | 166 | margin-right: auto; |
167 | 167 | } |
168 | 168 | |
169 | -/* label color */ | |
169 | +#newCard input[type=text] { | |
170 | + height: 3rem !important; | |
171 | +} | |
172 | + | |
170 | 173 | .input-field label { |
171 | 174 | color: #673ab7; |
172 | 175 | } |
templates/feed.html
View file @
2ad4961
... | ... | @@ -30,8 +30,8 @@ |
30 | 30 | <div class="row"> |
31 | 31 | <div class="input-field"> |
32 | 32 | <i class="mdi-editor-mode-edit prefix"></i> |
33 | - <input class="materialize-textarea" ng-model="text" type="text" maxlength="255" autofocus/> | |
34 | - <label id="newCardSign" for="newCard">New Flashcard</label> | |
33 | + <input id="new-card-input" class="materialize-textarea" ng-model="text" type="text" maxlength="255" autofocus/> | |
34 | + <label id="newCardSign" for="newCard">New Flashcard Description</label> | |
35 | 35 | </div> |
36 | 36 | </div> |
37 | 37 | </div> |