#26885: django admin jquery initial changed in 1.9+
-------------------------------+--------------------
     Reporter:  9nix00         |      Owner:  nobody
         Type:  Bug            |     Status:  new
    Component:  contrib.admin  |    Version:  1.9
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 Hi,all:

 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.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/049.2b38c40d29f79a756b6538c4fedc9d63%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to