Browse Source

Merge pull request #77 from Vindexus/content-timed-update

Update preview while typing contents
Robert Autenrieth 8 years ago
parent
commit
8da7073d7b
1 changed files with 11 additions and 0 deletions
  1. 11
    0
      generator/js/ui.js

+ 11
- 0
generator/js/ui.js View File

@@ -346,6 +346,14 @@ function ui_change_card_contents() {
346 346
     }
347 347
 }
348 348
 
349
+function ui_change_card_contents_keyup () {
350
+    clearTimeout(ui_change_card_contents_keyup.timeout)
351
+    ui_change_card_contents_keyup.timeout = setTimeout(function () {
352
+        $('#card-contents').trigger('change')
353
+    }, 200)
354
+}
355
+ui_change_card_contents_keyup.timeout = null
356
+
349 357
 function ui_change_card_tags() {
350 358
     var value = $(this).val();
351 359
 
@@ -506,6 +514,9 @@ $(document).ready(function () {
506 514
     $("#card-contents").change(ui_change_card_contents);
507 515
     $("#card-tags").change(ui_change_card_tags);
508 516
 
517
+    $("#card-contents").keyup(ui_change_card_contents_keyup);
518
+
519
+
509 520
     $("#page-size").change(ui_change_option);
510 521
     $("#page-rows").change(ui_change_option);
511 522
     $("#page-columns").change(ui_change_option);

Loading…
Cancel
Save