diff --git a/scripts/FlashcardDirective.js b/scripts/FlashcardDirective.js index 43c775c..93a0616 100644 --- a/scripts/FlashcardDirective.js +++ b/scripts/FlashcardDirective.js @@ -13,10 +13,10 @@ angular.module('flashy.FlashcardDirective', []). }, colNum: 0, colRank: 0, - link: function(scope, element) { + /*link: function(scope, element) { $('.tooltipped').tooltip(); // /* Handles width of the card */ - } + //} }; } diff --git a/scripts/FlashcardFactory.js b/scripts/FlashcardFactory.js index 8ae4ac9..018c936 100644 --- a/scripts/FlashcardFactory.js +++ b/scripts/FlashcardFactory.js @@ -59,8 +59,6 @@ angular.module('flashy.FlashcardFactory', ['ui.router']). var editableText = this.formatted_text; - //$('#flashcardEditText').html(this.formatted_text); - $('.modal-trigger').leanModal({ dismissible: true, // Modal can be dismissed by clicking outside of the modal opacity: .5, // Opacity of modal background @@ -71,7 +69,6 @@ angular.module('flashy.FlashcardFactory', ['ui.router']). $('#edit-card-input').html(editableText); - }, // Callback for Modal open complete: function () { @@ -86,12 +83,8 @@ angular.module('flashy.FlashcardFactory', ['ui.router']). Flashcard.prototype.refreshEditCardInput = function () { - console.log("ASDFASDFASDFASFD"); - - this.editCardText = $('#edit-card-input').text(); - this.submit_enabled = this.editCardText.length >= 5 && this.editCardText.length <= 160; @@ -145,7 +138,10 @@ angular.module('flashy.FlashcardFactory', ['ui.router']). }; if (myCard.text == '') { console.log('blank flashcard not pushed:' + myCard.text); - return closeNewCard(); + //return closeNewCard(); + + $('#editModal').closeModal(modal_options); + } $http.patch('/api/flashcards/' + this.id, myCard). success(function (data) { @@ -154,11 +150,18 @@ angular.module('flashy.FlashcardFactory', ['ui.router']). Materialize.toast("

Thanks for contributing! However, others won't see your card until you verify your email address

", 4000); } }); - //return .closeNewCardModal(); + + $('#editModal').closeModal(modal_options); } + Flashcard.prototype.discardChanges = function() { + + $('#editModal').closeModal(modal_options); + + } + return Flashcard; }); diff --git a/templates/flashcard.html b/templates/flashcard.html index 6c26712..ab3dce9 100644 --- a/templates/flashcard.html +++ b/templates/flashcard.html @@ -21,13 +21,11 @@

-
+
- -
@@ -36,17 +34,7 @@
- - - - +