Skip to content
This repository was archived by the owner on May 27, 2021. It is now read-only.

Commit bc03d86

Browse files
committed
#16: Cannot move the mouse out of the frame after resizing the frame
1 parent 3aefa5d commit bc03d86

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ v1.2.1
66
* Add Google Nexus 7 (2013)
77
* #13: Fix the width of device sub-menu
88
* #15: Set the Ajax loading indicator at the center of screen
9+
* #16: Cannot move the mouse out of the frame after resizing the frame
910

1011
v1.2.0 (2013/09/27)
1112

app/css/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@
4949
padding: 0;
5050
width: 100%;
5151
height: 100%;
52-
}
52+
}

app/js/responsivetest.js

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,22 +56,41 @@ angular
5656
$compile(newElement)($scope);
5757
$element.replaceWith(newElement);
5858
}
59-
}
59+
};
6060
})
6161
.directive('rtResizable', function() {
6262
return {
6363
restrict: 'A',
6464
link: function($scope, $element, $attrs) {
65-
var parent = $scope.$parent;
65+
var parentScope = $scope.$parent;
66+
67+
// Cannot move the mouse out of the frame after resizing the frame
68+
$element.css('position', 'relative');
69+
var $mask = $('<div/>').css({
70+
position: 'absolute',
71+
top: 0,
72+
width: 0,
73+
margin: 0,
74+
padding: 0,
75+
width: '100%',
76+
height: '100%'
77+
}).hide().prependTo($element);
78+
6679
$element.resizable({
80+
start: function(event, ui) {
81+
$mask.show();
82+
},
83+
stop: function(event, ui) {
84+
$mask.hide();
85+
},
6786
resize: function(event, ui) {
6887
$scope.w = ui.size.width * $scope.pxd;
6988
$scope.h = ui.size.height * $scope.pxd;
70-
parent.$apply();
89+
parentScope.$apply();
7190
}
7291
});
7392
}
74-
}
93+
};
7594
})
7695
.directive('rtKeyup', function() {
7796
// Handle the onKeyUp event
@@ -83,7 +102,7 @@ angular
83102
keyupHandler(evt.which);
84103
});
85104
});
86-
}
105+
};
87106
})
88107
.config(function($httpProvider) {
89108
var numLoadings = 0;

0 commit comments

Comments
 (0)