From b83f46393c7490924a580f01929817aed96a8e48 Mon Sep 17 00:00:00 2001 From: Andrew Buss Date: Tue, 19 May 2015 22:39:12 -0700 Subject: [PATCH] only listen for c outside of the model --- scripts/FeedController.js | 15 ++++++--------- templates/login.html | 2 +- templates/logout.html | 6 +++++- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/scripts/FeedController.js b/scripts/FeedController.js index ae88f70..b10eec4 100644 --- a/scripts/FeedController.js +++ b/scripts/FeedController.js @@ -36,6 +36,7 @@ angular.module('flashy.FeedController', ['ui.router']). console.log('pushed a card!'); $scope.cards.push(myCard); // Add right away $scope.refreshCards(); // Refresh list + listenForC = true; }). error(function (error) { console.log('haha, n00b'); @@ -55,17 +56,18 @@ angular.module('flashy.FeedController', ['ui.router']). console.log('refresh fail'); }); } - + var listenForC = true; $(document).keydown(function (e) { var keyed = e.which; - if (keyed == 67) { // "c" or "C" for compose + if (keyed == 67 && listenForC) { // "c" or "C" for compose $('#newCard').openModal(); + listenForC = false; + return false; } }); - $scope.flashcard = 'hi i am a flashcard. I need to be really long and awesome I ain\'t ' + - 'know how long I am right now. Is it good enough now?????????? Howz about now???'; + $scope.flashcard = ''; $scope.text = ''; $(document).ready(function () { @@ -75,11 +77,6 @@ angular.module('flashy.FeedController', ['ui.router']). opacity: 0, // Opacity of modal background in_duration: 300, // Transition in duration out_duration: 200, // Transition out duration - ready: function () { - $('input:text:visible:first').focus(); - }, - complete: function () { - } // Callback for Modal close*/ } ); }); diff --git a/templates/login.html b/templates/login.html index 6b3bed4..c606439 100644 --- a/templates/login.html +++ b/templates/login.html @@ -20,7 +20,7 @@
- +
diff --git a/templates/logout.html b/templates/logout.html index ecb6a2b..67cee23 100644 --- a/templates/logout.html +++ b/templates/logout.html @@ -1,3 +1,7 @@
-

You have successfully logged out.

+
+
+

You have successfully logged out.

+
+
\ No newline at end of file -- 1.9.1