Skip to content

Commit

Permalink
Fix for #175
Browse files Browse the repository at this point in the history
  • Loading branch information
lmangani authored Jul 6, 2016
1 parent 6cb1695 commit b7ec802
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion share/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,31 @@
$(element)
.draggable({
cancel: ".homer-modal-body, .close",
handle: ".homer-modal-header"
handle: ".homer-modal-header",
start: function( event, ui ) {
ui.helper[0].style.opacity=0.7;
var i = 0;
var elements=document.getElementsByClassName('opened');
for(i=0;i<elements.length;i++){if(!elements[i].style.zIndex){elements[i].style.zIndex=10001;}}
if (window.topZ){window.topZ++;ui.helper[0].style.zIndex = window.topZ; }
else{ui.helper[0].style.zIndex++;window.topZ = ui.helper[0].style.zIndex;}
},
stop: function( event, ui ) {
if (ui.helper[0]) {
ui.helper[0].style.opacity=1;
if (ui.offset.top < 0) ui.helper[0].style.top = '0px';
if (ui.offset.left < 0) ui.helper[0].style.left = '0px';
if ((ui.offset.left + 100 ) > window.innerWidth) {
ui.helper[0].style.left = (window.innerWidth - 100)+'px';
window.scrollTo(0, 0);
}
if ((ui.offset.top + 50 ) > window.innerHeight) {
ui.helper[0].style.top = (window.innerHeight - 50)+'px';
window.scrollTo(0, 0);
}

}
}
})
.resizable({
resize: function (evt, ui) {
Expand Down

0 comments on commit b7ec802

Please sign in to comment.