Skip to content

Commit 0dd25fa

Browse files
authored
Check if dragged out of windows
Added a check when dragging, onmouseup if is dragged out of the windows, is moved inside again. #197
1 parent 5a4c8b3 commit 0dd25fa

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Auditor/HTMLCSAuditor.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,14 @@ _global.HTMLCSAuditor = new function()
197197
};
198198

199199
_doc.onmouseup = function(e) {
200+
var maxHeight = window.innerHeight - 30;
201+
202+
if (mouseX > maxHeight) {
203+
wrapper.style.top = maxHeight + 'px';
204+
} else if (mouseX < 0) {
205+
wrapper.style.top = 0 + 'px';
206+
}
207+
200208
dragging = false;
201209
};
202210

0 commit comments

Comments
 (0)