Merge lp:~openerp-dev/openobject-client-web/trunk-prevent-click-before-document-is-ready into lp:openobject-client-web/trunk
Proposed by
Olivier Laurent (Open ERP)
Status: | Merged |
---|---|
Merged at revision: | 4102 |
Proposed branch: | lp:~openerp-dev/openobject-client-web/trunk-prevent-click-before-document-is-ready |
Merge into: | lp:openobject-client-web/trunk |
Diff against target: |
157 lines (+49/-24) 4 files modified
addons/openerp/controllers/templates/header.mako (+6/-0) addons/openerp/controllers/templates/index.mako (+25/-19) addons/openerp/static/javascript/openerp/openerp.base.js (+12/-5) openobject/controllers/templates/base.mako (+6/-0) |
To merge this branch: | bzr merge lp:~openerp-dev/openobject-client-web/trunk-prevent-click-before-document-is-ready |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Xavier (Open ERP) (community) | Needs Fixing | ||
Review via email:
|
Description of the change
To post a comment you must log in.
* There's commented code commited fn.delegate( ) rather than live() (it's easier to understand, and though that's not really relevant for us it can also be set on an arbitrary root element) ion`, no need for both document) .delegate` and don't need to perform specific tests (presence or not of an element for instance) you might as well move the behavior into a JS file instead of leaving it into a template. You're not unbinding the event anyway so… '#add_user_ widget' ).live, Query(' div#shortcuts a ').live, …) maybe just prefix the jQuery.ready call in openerp.base.js by a blanked preventDefault along the lines of:
* I'd recommend using jQuery.
* A `return false` in an event handler combines `e.preventDefault` and `e.stopPropagat
* If you use `.live()` or `jQuery(
* Instead of creating one-off preventDefault calls (jQuery(
jQuery( document) .delegate( 'a[href] :not([target] ):not([ href^=" #"]):not( [href^= "javascript" ]):not( [rel=external] )', 'click', function (e) {
e.preventDefau lt();
});
and undelegate() it right before setting up the "real" event delegation targets?