diff --git a/cms/static/js/base.js b/cms/static/js/base.js
index dd47f93cce..01a8d6450e 100644
--- a/cms/static/js/base.js
+++ b/cms/static/js/base.js
@@ -292,16 +292,15 @@ function onSectionReordered(event, ui) {
}
function _handleReorder(event, ui, parentIdField, childrenSelector) {
- // figure out where it came from and where it slots in.
+ // figure out where it came from and where it slots in.
var subsection_id = $(event.target).data(parentIdField);
- var _els = $(event.target).children(childrenSelector);
- var children = _els.map(function(idx, el) { return $(el).data('id'); }).get();
- // if new to this parent, figure out which parent to remove it from and do so
- if (!_.contains(children, ui.draggable.data('id'))) {
- var old_parent = ui.draggable.parent();
- var old_children = old_parent.children(childrenSelector).map(function(idx, el) { return $(el).data('id'); }).get();
- old_children = _.without(old_children, ui.draggable.data('id'));
- // call into server to commit the new order
+ var _els = $(event.target).children(childrenSelector);
+ var children = _els.map(function(idx, el) { return $(el).data('id'); }).get();
+ // if new to this parent, figure out which parent to remove it from and do so
+ if (!_.contains(children, ui.draggable.data('id'))) {
+ var old_parent = ui.draggable.parent();
+ var old_children = old_parent.children(childrenSelector).map(function(idx, el) { return $(el).data('id'); }).get();
+ old_children = _.without(old_children, ui.draggable.data('id'));
$.ajax({
url: "/save_item",
type: "POST",
@@ -309,30 +308,29 @@ function _handleReorder(event, ui, parentIdField, childrenSelector) {
contentType: "application/json",
data:JSON.stringify({ 'id' : old_parent.data(parentIdField), 'children' : old_children})
});
- //
- }
- else {
- // staying in same parent
- // remove so that the replacement in the right place doesn't double it
- children = _.without(children, ui.draggable.data('id'));
- }
- // add to this parent (figure out where)
- for (var i = 0; i < _els.length; i++) {
- if (!ui.draggable.is(_els[i]) && ui.offset.top < $(_els[i]).offset().top) {
- // insert at i in children and _els
- ui.draggable.insertBefore($(_els[i]));
- // TODO figure out correct way to have it format (and similar line below)
- ui.draggable.attr("style", "position:relative;");
- children.splice(i, 0, ui.draggable.data('id'));
- break;
- }
- }
- // see if it goes at end (the above loop didn't insert it)
- if (!_.contains(children, ui.draggable.data('id'))) {
- $(event.target).append(ui.draggable);
- ui.draggable.attr("style", "position:relative;"); // STYLE hack too
- children.push(ui.draggable.data('id'));
- }
+ }
+ else {
+ // staying in same parent
+ // remove so that the replacement in the right place doesn't double it
+ children = _.without(children, ui.draggable.data('id'));
+ }
+ // add to this parent (figure out where)
+ for (var i = 0; i < _els.length; i++) {
+ if (!ui.draggable.is(_els[i]) && ui.offset.top < $(_els[i]).offset().top) {
+ // insert at i in children and _els
+ ui.draggable.insertBefore($(_els[i]));
+ // TODO figure out correct way to have it remove the style: top:n; setting (and similar line below)
+ ui.draggable.attr("style", "position:relative;");
+ children.splice(i, 0, ui.draggable.data('id'));
+ break;
+ }
+ }
+ // see if it goes at end (the above loop didn't insert it)
+ if (!_.contains(children, ui.draggable.data('id'))) {
+ $(event.target).append(ui.draggable);
+ ui.draggable.attr("style", "position:relative;"); // STYLE hack too
+ children.push(ui.draggable.data('id'));
+ }
$.ajax({
url: "/save_item",
type: "POST",
@@ -340,7 +338,7 @@ function _handleReorder(event, ui, parentIdField, childrenSelector) {
contentType: "application/json",
data:JSON.stringify({ 'id' : subsection_id, 'children' : children})
});
-
+
}
function getEdxTimeFromDateTimeVals(date_val, time_val, format) {
diff --git a/common/static/js/vendor/jquery-ui.min.js b/common/static/js/vendor/jquery-ui.min.js
index e36a7f0f6c..9c44a8b01b 100755
--- a/common/static/js/vendor/jquery-ui.min.js
+++ b/common/static/js/vendor/jquery-ui.min.js
@@ -1,125 +1,6 @@
-/*! jQuery UI - v1.8.22 - 2012-07-24
-* https://github.com/jquery/jquery-ui
-* Includes: jquery.ui.core.js
-* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
-(function(a,b){function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;return!b.href||!g||f.nodeName.toLowerCase()!=="map"?!1:(h=a("img[usemap=#"+g+"]")[0],!!h&&d(h))}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.ui=a.ui||{};if(a.ui.version)return;a.extend(a.ui,{version:"1.8.22",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;return a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0),/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a("").outerWidth(1).jquery||a.each(["Width","Height"],function(c,d){function h(b,c,d,f){return a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)}),c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){return c===b?g["inner"+d].call(this):this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){return typeof b!="number"?g["outer"+d].call(this,b):this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:a.expr.createPseudo?a.expr.createPseudo(function(b){return function(c){return!!a.data(c,b)}}):function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.curCSS||(a.curCSS=a.css),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!d||!a.element[0].parentNode)return;for(var e=0;e
| '+this._get(a,"weekHeader")+" | ":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="=5?' class="ui-datepicker-week-end"':"")+">"+''+C[T]+" | "}Q+=R+"'+this._get(a,"calculateWeek")(Y)+" | ":"";for(var S=0;S<7;S++){var ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[0]||l&&Y"+(bb&&!G?" ":bc?''+Y.getDate()+"":''+Y.getDate()+"")+" | ",Y.setDate(Y.getDate()+1),Y=this._daylightSavingAdjust(Y)}Q+=_+""}n++,n>11&&(n=0,o++),Q+="
|---|