Does somebody can explain why we change `jquery.init.js` file in admin
module ?
in current code, this style cause some scope issue.
we can't get `jQuery`,`$` in global.
{{{
/*global django:true, jQuery:false*/
/* Puts the included jQuery into our own namespace using noConflict and
passing
* it 'true'. This ensures that the included jQuery doesn't pollute the
global
* namespace (i.e. this preserves pre-existing values for both window.$
and
* window.jQuery).
*/
var django = django || {};
django.jQuery = jQuery.noConflict(true);
}}}
in 1.8 release package . the code is
{{{
var django = django || {};
django.jQuery = jQuery;
var yl = yl || {};
yl.jQuery = django.jQuery;
// this file also prevents django.jQuery.noConflict
// there's got to be a better way ...
}}}
I don't think this is a better improve .
we have so many plugins depend on global jQuery or $ ! we can't use them
anymore,we have to add custom jQuery lib or change code to local scope.
I submit a PR , if you agree with me, please confirm it.
--
Ticket URL: <https://code.djangoproject.com/ticket/26885>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
github PR [https://github.com/django/django/pull/6900]
--
Ticket URL: <https://code.djangoproject.com/ticket/26885#comment:1>
Comment (by timgraham):
I'm confused by the report. `jquery.init.js` seems to be identical in
Django 1.8 and 1.9:
{{{
var django = django || {};
django.jQuery = jQuery.noConflict(true);
}}}
The [https://docs.djangoproject.com/en/stable/ref/contrib/admin/#jquery
rationale for namespacing] is described in the documentation.
--
Ticket URL: <https://code.djangoproject.com/ticket/26885#comment:2>
* status: new => closed
* resolution: => invalid
Comment:
Like Tim said, nothing changed at this level in Django 1.9.
--
Ticket URL: <https://code.djangoproject.com/ticket/26885#comment:3>