Ticket #19924: 0001-fixed-selectors-in-actions.js-did-not-use-options.patch

File 0001-fixed-selectors-in-actions.js-did-not-use-options.patch, 1.7 KB (added by crccheck, 12 years ago)

sketch of the change to be made

  • django/contrib/admin/static/admin/js/actions.js

    From 45853611ad7cc974b1c6bcf61c894fed0187e0c1 Mon Sep 17 00:00:00 2001
    From: crccheck <c@crccheck.com>
    Date: Wed, 27 Feb 2013 03:50:12 +0000
    Subject: [PATCH] fixed selectors in actions.js did not use options
    
    I'm using the selector style, `$(selector, parentSelector)`, which is not
    my preferred style. Given that the parent selector is only available
    to me as a string, I feel like this method preserves the original style
    as much as possible. Internally, jQuery/sizzle just converts the second
    argument to a jQuery object and runs .find() on it.
    ---
     django/contrib/admin/static/admin/js/actions.js |    6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/django/contrib/admin/static/admin/js/actions.js b/django/contrib/admin/static/admin/js/actions.js
    index 1992a70..51e05a0 100644
    a b  
    6767                        checker($(this).prop("checked"));
    6868                        updateCounter();
    6969                });
    70                 $("div.actions span.question a").click(function(event) {
     70                $("a", options.acrossQuestions).click(function(event) {
    7171                        event.preventDefault();
    7272                        $(options.acrossInput).val(1);
    7373                        showClear();
    7474                });
    75                 $("div.actions span.clear a").click(function(event) {
     75                $("a", options.acrossClears).click(function(event) {
    7676                        event.preventDefault();
    7777                        $(options.allToggle).prop("checked", false);
    7878                        clearAcross();
     
    111111                });
    112112                $('form#changelist-form input[name="_save"]').click(function(event) {
    113113                        var action_changed = false;
    114                         $('div.actions select option:selected').each(function() {
     114                        $('select option:selected', options.actionContainer).each(function() {
    115115                                if ($(this).val()) {
    116116                                        action_changed = true;
    117117                                }
Back to Top