Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -281,14 +281,7 @@ | |
} | ||
// attach listener for expanding/collapsing the target | ||
buttons[i].addEventListener('click', function (e) { | ||
toggle(this); | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
return false; | ||
}); | ||
clickHandler(buttons[i], toggle); | ||
if (states.hasOwnProperty(targetId)) { | ||
// open or collapse based on stored data | ||
|
@@ -380,14 +373,7 @@ | |
throw "Tab target " + targetId + " does not exist"; | ||
} | ||
tabs[i].addEventListener('click', function (e) { | ||
select(this); | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
return false; | ||
}); | ||
clickHandler(buttons[i], select); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
aik099
|
||
Sfjs.addClass(target, 'hidden'); | ||
} | ||
|
@@ -405,7 +391,26 @@ | |
} | ||
var tabTarget = new TabView(), | ||
toggler = new Toggler(new JsonStorage(sessionStorage)); | ||
toggler = new Toggler(new JsonStorage(sessionStorage)), | ||
clickHandler = function (element, callback) { | ||
Sfjs.addEventListener(element, 'click', function (e) { | ||
if (!e) { | ||
e = window.event; | ||
} | ||
callback(e.target || e.srcElement); | ||
if (e.preventDefault) { | ||
e.preventDefault(); | ||
} else { | ||
e.returnValue = false; | ||
} | ||
e.stopPropagation(); | ||
return false; | ||
}); | ||
}; | ||
tabTarget.initTabs(document.querySelectorAll('.tree .tree-inner')); | ||
toggler.initButtons(document.querySelectorAll('a.toggle-button')); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,6 +171,18 @@ | |
requestCounter[0].className = className; | ||
}; | ||
var addEventListener; | ||
if (document.addEventListener) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
aik099
|
||
addEventListener = function (element, eventName, callback) { | ||
element.attachEvent('on' + eventName, callback); | ||
}; | ||
} else { | ||
addEventListener = function (element, eventName, callback) { | ||
element.addEventListener(eventName, callback, false); | ||
}; | ||
} | ||
{% if excluded_ajax_paths is defined %} | ||
var proxied = XMLHttpRequest.prototype.open; | ||
|
@@ -189,7 +201,7 @@ | |
requestStack.push(stackElement); | ||
this.addEventListener("readystatechange", function() { | ||
addEventListener(this, 'readystatechange', function() { | ||
This comment has been minimized.
Sorry, something went wrong.
stof
Member
|
||
if (self.readyState == 4) { | ||
stackElement.duration = new Date() - stackElement.start; | ||
stackElement.loading = false; | ||
|
@@ -199,7 +211,7 @@ | |
Sfjs.renderAjaxRequests(); | ||
} | ||
}, false); | ||
}); | ||
Sfjs.renderAjaxRequests(); | ||
} | ||
|
@@ -219,6 +231,8 @@ | |
setPreference: setPreference, | ||
addEventListener: addEventListener, | ||
request: request, | ||
renderAjaxRequests: renderAjaxRequests, | ||
|
13 comments
on commit 21693e4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes broke profiler at Chrome and FF for me:
TypeError: element.attachEvent is not a function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now I have no time to check this, but after pulled this update I'm experiencing the following issue in Google Chrome Version 40.0.2214.111 (64-bit): Uncaught SyntaxError: Unexpected token u
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@phidah , any stack trace of this error?
And please don't use dev branches of Symfony on production websites.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After some sort of debug, I found that the error is thrown inside jQuery (v1.11.1) XHR call (onreadystatechange value is always 0
), but note in the stack trace that line 73 at document
request is where the debug toolbar script is placed in my HTML structure:
stack: "TypeError: undefined is not a function↵ at addEventListener (http://example.com/:73:7224)↵ at XMLHttpRequest.open (http://example.com/:73:8146)↵ at Object.m.ajaxTransport.send (http://example.com/js/98707ec_jquery.min_1.js:4:25247)↵ at Function.m.extend.ajax (http://example.com/js/98707ec_jquery.min_1.js:4:21302)↵ at Object.generalController.openLogin (http://example.com/js/2660862_general-controller_40.js:783:9)↵ at HTMLButtonElement.<anonymous> (http://example.com/js/2660862_general-controller_40.js:768:14)↵ at HTMLButtonElement.m.event.dispatch (http://example.com/js/98707ec_jquery.min_1.js:3:8436)↵ at HTMLButtonElement.m.event.add.r.handle (http://example.com/js/98707ec_jquery.min_1.js:3:5146)"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this has something to do with way how we set readystatechange
event handler. Anybody else experiencing this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing for me, same error. The 'element' here is a XMLHttpRequest and does not have the method attachEvent. Happens in Chrome and FF latest version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have some error.
stack: "TypeError: undefined is not a function↵ at addEventListener (
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here - does not work on Chrome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
People, stop writing same here
. Just submit PR with a fix and make everybody else happier. 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't want to discuss that as I'm fine with that as long as the issue is somewhere on the list. But
Anybody else experiencing this?
seems like a question to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess at least 5 people do. If have an Internet Explorer around, where you can test then please try doing what @stof suggested in 21693e4#commitcomment-9697996 and see if that helps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirm these lines broke the debug tool bar in chrome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyone having an issue, please try #13729 to confirm that it fixes it for you
Should not it be
clickHandler(tabs[i], select);
? Anyway this code breaks completely the form panel in the profiler.