Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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.
  • Loading branch information...
commit d9b12ecbe62aa7c9fb0f913e7eefc21662f8e21b 1 parent 0a9ea56
Andrew Jesaitis andrewjesaitis authored claudep committed
5 django/contrib/admin/static/admin/js/calendar.js
View
@@ -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(' '),
5 django/contrib/admin/static/admin/js/core.js
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.