incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject git commit: [#6803] ticket:467 added blur handling to label edit widget
Date Tue, 05 Nov 2013 22:48:49 GMT
Updated Branches:
  refs/heads/master d43e302f8 -> 17caadbe7


[#6803] ticket:467 added blur handling to label edit widget


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/17caadbe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/17caadbe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/17caadbe

Branch: refs/heads/master
Commit: 17caadbe717d04a2c5cc76b8199bceecba60b5fb
Parents: d43e302
Author: coldmind <sokandpal@yandex.ru>
Authored: Wed Oct 30 20:39:49 2013 +0200
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Tue Nov 5 22:48:13 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/widgets/form_fields.py            | 16 ++++++++++++++++
 .../templates/tracker_widgets/mass_edit_form.html   |  2 +-
 ForgeTracker/forgetracker/widgets/ticket_form.py    |  6 ------
 3 files changed, 17 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/17caadbe/Allura/allura/lib/widgets/form_fields.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/form_fields.py b/Allura/allura/lib/widgets/form_fields.py
index 221e0fc..7cd82e2 100644
--- a/Allura/allura/lib/widgets/form_fields.py
+++ b/Allura/allura/lib/widgets/form_fields.py
@@ -72,6 +72,22 @@ class LabelEdit(ew.InputField):
               'width':'100%%',
               'autocomplete_url':'%(url)stags'
           });
+          $('form').on('blur', '.ui-autocomplete-input', function() {
+              setTimeout(function(){
+                  var clicked = $(document.activeElement); // This is the element that has
focus
+                  if (clicked.is('#ui-active-menuitem')) {
+                      return false;
+                  } else {
+                      var value = $('div.tagsinput div input').val();
+                      var exists = $('input.label_edit').tagExist(value);
+                      var default_value = $('div.tagsinput div input').attr('data-default');
+                      if ((value !== default_value) && (!exists) && value
!== '') {
+                          $('input.label_edit').addTag(value);
+                      }
+                      $('input[type=submit]', this).attr('disabled', 'disabled');
+                  }
+                }, 1);
+            });
         ''' % dict(url=c.app.url))
 
 class ProjectUserSelect(ew.InputField):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/17caadbe/ForgeTracker/forgetracker/templates/tracker_widgets/mass_edit_form.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/templates/tracker_widgets/mass_edit_form.html b/ForgeTracker/forgetracker/templates/tracker_widgets/mass_edit_form.html
index da7098c..666c325 100644
--- a/ForgeTracker/forgetracker/templates/tracker_widgets/mass_edit_form.html
+++ b/ForgeTracker/forgetracker/templates/tracker_widgets/mass_edit_form.html
@@ -108,4 +108,4 @@
     </div>
     <div class="grid-12" id="result"></div>
     <input name="__search" type="hidden" value="" id="id_search" />
-</form>
+</form>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/17caadbe/ForgeTracker/forgetracker/widgets/ticket_form.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/widgets/ticket_form.py b/ForgeTracker/forgetracker/widgets/ticket_form.py
index f022177..5f0a6fb 100644
--- a/ForgeTracker/forgetracker/widgets/ticket_form.py
+++ b/ForgeTracker/forgetracker/widgets/ticket_form.py
@@ -141,12 +141,6 @@ class TicketForm(GenericTicketForm):
                 evt.preventDefault();
             });
             $('form').submit(function() {
-                var value = $('div.tagsinput div input').val();
-                var exists = $('input.label_edit').tagExist(value);
-                var default_value = $('div.tagsinput div input').attr('data-default');
-                if ((value !== default_value) && (!exists) && value !== ''){
-                    $('input.label_edit').addTag(value);
-                }
                 $('input[type=submit]', this).attr('disabled', 'disabled');
             });
             $('div.reply.discussion-post a.markdown_preview').click(function(){


Mime
View raw message