From cbc3a791386a277a872b483baed7900ae43577e4 Mon Sep 17 00:00:00 2001 From: d42 Date: Fri, 27 Apr 2018 23:19:59 +0200 Subject: [PATCH] yolo --- static/admin/js/django_hstore/hstore-widget.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/static/admin/js/django_hstore/hstore-widget.js b/static/admin/js/django_hstore/hstore-widget.js index f5e991b..3723f27 100644 --- a/static/admin/js/django_hstore/hstore-widget.js +++ b/static/admin/js/django_hstore/hstore-widget.js @@ -1,5 +1,3 @@ -var xD = $; - var initDjangoHStoreWidget = function(hstore_field_name, inline_prefix) { // ignore inline templates // if hstore_field_name contains "__prefix__" @@ -7,8 +5,6 @@ var initDjangoHStoreWidget = function(hstore_field_name, inline_prefix) { return; } - var $ = django.jQuery; - // processing inlines if(hstore_field_name.indexOf('inline') > -1){ var inlineClass = $('#id_'+hstore_field_name).parents('.inline-related, .grp-group').attr('class'); @@ -122,8 +118,8 @@ var initDjangoHStoreWidget = function(hstore_field_name, inline_prefix) { $hstore.delegate('a.hs-add-row, .hs-add-row a', 'click', function(e) { e.preventDefault(); $hstore.find('.hstore-rows').append(empty_row); - xD('.django-select2').djangoSelect2() - xD('select').on( 'select2:close', function () { + $('.django-select2').djangoSelect2() + $('select').on( 'select2:close', function () { $(this).focus(); }); }); @@ -161,7 +157,7 @@ var initDjangoHStoreWidget = function(hstore_field_name, inline_prefix) { hstore_rows.show(); add_row.show(); - xD('.django-select2').djangoSelect2() + $('.django-select2').djangoSelect2() } else{ raw_textarea.show();