Index: lams_central/web/authoring/authoring.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/authoring/authoring.jsp,v diff -u -r1.6.2.30 -r1.6.2.31 --- lams_central/web/authoring/authoring.jsp 25 Oct 2016 12:29:39 -0000 1.6.2.30 +++ lams_central/web/authoring/authoring.jsp 28 Oct 2016 16:21:03 -0000 1.6.2.31 @@ -688,7 +688,7 @@ -
+ @@ -931,7 +931,24 @@ +
+
+
+
+ + + +
+
+
+
').addClass('groupName').appendTo(dialog).val(this.name); - dialog.append('
'); + $('').addClass('groupName').appendTo(groupsDiv).val(this.name); }); - dialog.dialog('open'); + dialog.modal('show'); }, @@ -1760,25 +1749,50 @@ */ openPropertiesDialog : function(object) { object.loadPropertiesDialogContent(); - var dialog = layout.propertiesDialog; - dialog.children().detach(); - dialog.append(object.propertiesContent); + var dialog = layout.propertiesDialog, + modalBody = $('.modal-body', dialog); + modalBody.children().detach(); + modalBody.append(object.propertiesContent); if (object.readOnly) { // make all widgets read-only - dialog.find('input, select, textarea').attr('disabled', 'disabled'); + dialog.find('input, select, textarea').prop('disabled', true); dialog.find('.spinner').spinner('option', 'disabled', true); } - dialog.dialog('open'); dialog.find('input').blur(); - var box = object.items.getBBox(), - x = box.x2 + canvas.offset().left + 5, - y = box.y + canvas.offset().top; - dialog.dialog('option', 'position', [x, y]); - if (dialog.offset().left < box.x2 + canvas.offset().left) { - // if dialog covers the activity (too close to right border), - // move it to the other side - x = box.x + canvas.offset().left - dialog.width() - 35; - dialog.dialog('option', 'position', [x, y]); + dialog.on('shown.bs.modal', function(){ + var box = object.items.getBBox(), + canvasOffset = canvas.offset(), + canvasWidth = canvas.width(), + canvasHeight = canvas.height(), + dialogWidth = dialog.width(), + dialogHeight = dialog.height(), + x = box.x2 + canvasOffset.left + 5, + y = box.y + canvasOffset.top - dialogHeight; + + if (x + dialogWidth > canvasOffset.left + canvasWidth + 30) { + // if dialog covers the activity (too close to right border), + // move it to the other side + x = box.x + canvasOffset.left - dialogWidth; + } + + if (y < canvasOffset.top) { + y = box.y + canvasOffset.top; + var adjuster = 0; + while (y > canvasOffset.top && y + dialogHeight > canvasOffset.top + canvasHeight){ + y -= adjuster++; + }; + } + + dialog.offset({ + 'left' : x, + 'top' : y + }); + }); + + if (dialog.css('display') == 'none') { + dialog.modal('show'); + } else { + dialog.trigger('shown.bs.modal'); } },