From d9b12ecbe62aa7c9fb0f913e7eefc21662f8e21b Mon Sep 17 00:00:00 2001 From: Andrew Jesaitis Date: Fri, 22 Mar 2013 22:43:07 -0600 Subject: [PATCH] Moved removeChildren to core.js The function removeChildren is a general utility that other functions might want to use. Fixes #4120. Thanks arvin for the initial patch. --- django/contrib/admin/static/admin/js/calendar.js | 5 +---- django/contrib/admin/static/admin/js/core.js | 5 +++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/django/contrib/admin/static/admin/js/calendar.js b/django/contrib/admin/static/admin/js/calendar.js index 39f5f79062..8e38c41c68 100644 --- a/django/contrib/admin/static/admin/js/calendar.js +++ b/django/contrib/admin/static/admin/js/calendar.js @@ -1,11 +1,8 @@ /* calendar.js - Calendar functions by Adrian Holovaty +depends on core.js for utility functions like removeChildren or quickElement */ -function removeChildren(a) { // "a" is reference to an object - while (a.hasChildNodes()) a.removeChild(a.lastChild); -} - // CalendarNamespace -- Provides a collection of HTML calendar-related helper functions var CalendarNamespace = { monthsOfYear: gettext('January February March April May June July August September October November December').split(' '), diff --git a/django/contrib/admin/static/admin/js/core.js b/django/contrib/admin/static/admin/js/core.js index 7358a249aa..4cc4ca4f63 100644 --- a/django/contrib/admin/static/admin/js/core.js +++ b/django/contrib/admin/static/admin/js/core.js @@ -50,6 +50,11 @@ function quickElement() { return obj; } +// "a" is reference to an object +function removeChildren(a) { + while (a.hasChildNodes()) a.removeChild(a.lastChild); +} + // ---------------------------------------------------------------------------- // Cross-browser xmlhttp object // from http://jibbering.com/2002/4/httprequest.html