Skip to contentSkip to conversation

bitbake: toaster: filtersnippet remove redefinition of filter type key

PATCH Superseded Michael Wood 2 participants 3 messages Apr 27, 2015 – May 1, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bitbake: toaster: filtersnippet remove redefinition of filter type key

This redefinition is not needed and also used Mozilla specific API to access the data thus breaking the date filter in all other browsers.

---
 bitbake/lib/toaster/toastergui/static/js/filtersnippet.js | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
bitbake/lib/toaster/toastergui/static/js/filtersnippet.js +1 -3
index 27b057e..6527d61 100755
@@ -79,9 +79,7 @@ function date_init (key, from_date, to_date, min_date, max_date, initial_enable)
     // catch the submit (just once)
     $("form").unbind('submit');
     $("form").submit(function(e) {
-        // format a composite daterange filter value so that it can be parsed and post-processed in the view
-        var key=e.originalEvent.explicitOriginalTarget.getAttribute("data-key")
-        if (typeof key != "undefined") {
+        if (key !== undefined) {
             if ($("#date_from_"+key).length) {
                 var filter=key+"__gte!"+key+"__lt:"+$("#date_from_"+key).val()+"!"+$("#date_to_"+key).val()+"_daterange";
                 $("#last_date_from_"+key).val($("#date_from_"+key).val());
Signature · 1 line
2.1.0
#1 lore raw

PATCH v2 1/1 bitbake: toaster: filtersnippet remove redefinition of filter type key

This redefinition is not needed and also used Mozilla specific API to access the data thus breaking the date filter in all other browsers.

[YOCTO #7577]

---
 bitbake/lib/toaster/toastergui/static/js/filtersnippet.js | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
bitbake/lib/toaster/toastergui/static/js/filtersnippet.js +1 -2
index 27b057e..2b84c54 100755
@@ -80,8 +80,7 @@ function date_init (key, from_date, to_date, min_date, max_date, initial_enable)
     $("form").unbind('submit');
     $("form").submit(function(e) {
         // format a composite daterange filter value so that it can be parsed and post-processed in the view
-        var key=e.originalEvent.explicitOriginalTarget.getAttribute("data-key")
-        if (typeof key != "undefined") {
+        if (key !== undefined) {
             if ($("#date_from_"+key).length) {
                 var filter=key+"__gte!"+key+"__lt:"+$("#date_from_"+key).val()+"!"+$("#date_to_"+key).val()+"_daterange";
                 $("#last_date_from_"+key).val($("#date_from_"+key).val());
Signature · 1 line
2.1.0
#2 lore raw

Taken for submission,

Thank you,
Alex

Quoted 38 lines · Michael Wood

This redefinition is not needed and also used Mozilla specific API to access the data thus breaking the date filter in all other browsers.

[YOCTO #7577]

---
 bitbake/lib/toaster/toastergui/static/js/filtersnippet.js | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
bitbake/lib/toaster/toastergui/static/js/filtersnippet.js +0 -0
index 27b057e..2b84c54 100755
@@ -80,8 +80,7 @@ function date_init (key, from_date, to_date, min_date,
 max_date, initial_enable)
     $("form").unbind('submit');
     $("form").submit(function(e) {
         // format a composite daterange filter value so that it can be

parsed and post-processed in the view
- var
key=e.originalEvent.explicitOriginalTarget.getAttribute("data-key")

bitbake/lib/toaster/toastergui/static/js/filtersnippet.js +1 -1
-        if (typeof key != "undefined") {
+        if (key !== undefined) {
             if ($("#date_from_"+key).length) {
                 var
filter=key+"__gte!"+key+"__lt:"+$("#date_from_"+key).val()+"!"+$("#date_to_"+key).val()+"_daterange";
                 $("#last_date_from_"+key).val($("#date_from_"+key).val());

--
2.1.0

--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster

Signature · 3 lines
Alex Damian
Yocto Project
SSG / OTC