myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject [myfaces-tobago] 01/02: remove deprecated 'selector' method from tobago-suggest.js
Date Thu, 21 Jun 2018 12:34:14 GMT
This is an automated email from the ASF dual-hosted git repository.

lofwyr pushed a commit to branch tobago-3.0.x
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit fe9548a909339ca8720006c55264e854034b0f1a
Author: Henning Noeth <hnoeth@apache.org>
AuthorDate: Thu Jun 7 14:22:31 2018 +0200

    remove deprecated 'selector' method from tobago-suggest.js
    
    need to replace the selector method in tobago-suggest.js; otherwise
    with jQuery3 the dropdown menu is not append on the
    tobago-page-menuStore
    
    (cherry picked from commit 0d2b782)
---
 .../resources/tobago/standard/script/tobago-suggest.js         | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/tobago/standard/script/tobago-suggest.js
b/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/tobago/standard/script/tobago-suggest.js
index 4e4228b..9b8c05f 100644
--- a/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/tobago/standard/script/tobago-suggest.js
+++ b/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/tobago/standard/script/tobago-suggest.js
@@ -98,14 +98,18 @@ Tobago.Suggest.init = function(elements) {
         source = Tobago.Suggest.fromClient(data2);
       }
 
-      var $suggestPopup = jQuery(Tobago.Utils.escapeClientId(suggest.attr('id') + "::popup"));
-      if($suggestPopup.length > 0) {
+      function getSuggestPopup(suggest) {
+        return jQuery(Tobago.Utils.escapeClientId(suggest.attr('id') + "::popup"));
+      }
+
+      var $suggestPopup = getSuggestPopup(suggest);
+      if ($suggestPopup.length > 0) {
         $suggestPopup.remove();
       }
 
       jQuery(".tobago-page-menuStore")
           .append("<div id='" + suggest.attr('id') + "::popup" + "' class='tt-menu tt-empty'/>");
-      $suggestPopup = jQuery($suggestPopup.selector);
+      $suggestPopup = getSuggestPopup(suggest);
 
       input.typeahead({
         menu: $suggestPopup,


Mime
View raw message