Permalink
Browse files

Fixed issue with double click to edit note;

  • Loading branch information...
1 parent e6ee16a commit 70c42ef8b3e7b8fe9f1367257f0b6bfa01470f5c @adamrenklint adamrenklint committed Aug 25, 2011
Showing with 16 additions and 8 deletions.
  1. +1 −2 js/frontend/notes.js
  2. +1 −1 js/helpers/dialogs.js
  3. +13 −4 js/notes/note.js
  4. +1 −1 note.html
View
@@ -22,8 +22,7 @@ notes.openNotesWindow = function() {
minWidth : 500,
height : parseInt(Titanium.App.Properties.getString('note_user_height', '400')),
minHeight : 400,
- maximized : Titanium.App.Properties.getString('maximized', 'false'),
- wunderlist: wunderlist
+ maximized : Titanium.App.Properties.getString('maximized', 'false')
});
note_user_x = Titanium.App.Properties.getString('note_user_x', 'none');
View
@@ -330,7 +330,7 @@ dialogs.openNoteDeleteDialog = function() {
buttons[wunderlist.language.data.delete_note_no] = function() { $(this).dialog('close'); };
buttons[wunderlist.language.data.delete_note_yes] = function() {
$('textarea#noteTextarea').val('');
- $('input#save-and-close').click();
+ $('input#save').trigger('deleteNote');
dialogs.closeDialog(dialogs.deleteNoteDialog);
};
View
@@ -95,13 +95,20 @@ $(function() {
dialogs.openNoteDeleteDialog();
} else {
$('textarea#noteTextarea').val('');
- $('input#save-and-close').click();
+ $('input#save').click();
}
});
+ $('input#save').live('deleteNote', function () {
+ $('textarea#noteTextarea').val('');
+ note.editMode = true;
+ $('input#save').click();
+ });
+
// Save / Edit Button
- $('input#save').live('click', function() {
+ $('input#save').live('click', function() {
+
mainContent = mainWindow.document.getElementById("content");
noteElement = $(mainContent).children('ul').children('li#' + note.noteId).children('span.note');
@@ -111,7 +118,7 @@ $(function() {
note.editMode = true;
$(this).addClass("button-login").val(wunderlist.language.data.save_changes).show();
- $('input#save-and-close').show();
+ //$('input#save-and-close').show();
$('span.hint').show();
$('textarea#noteTextarea').val(unescape(mainWindow.Encoder.htmlDecode(note.text))).show().focus();
@@ -123,7 +130,7 @@ $(function() {
note.editMode = false;
$(this).removeClass("button-login").val(wunderlist.language.data.edit_changes);
- $('input#save-and-close').hide();
+ //$('input#save-and-close').hide();
$('span.hint').hide();
newNote = wunderlist.xss_clean($('textarea#noteTextarea').val());
@@ -139,6 +146,8 @@ $(function() {
mainWindow.task.id = note.noteId;
mainWindow.task.note = note.text;
mainWindow.task.update();
+
+ note.close();
}
if($('textarea#noteTextarea').val().length == 0)
View
@@ -31,7 +31,7 @@
<div class="notes_buttons">
<span id="hint" class="hint"></span>
- <input id="save-and-close" class="input-button button-login" type="submit" value="Save & Close" />
+ <input id="save" class="input-button button-login" type="submit" value="Save" />
<input id="delete" class="input-button destructive" type="submit" value="Delete" />
</div>
</div>

0 comments on commit 70c42ef

Please sign in to comment.