In my directive I am handling jqueryui.resizeable I was having an issue where it was very jittery and froze ALOT in firefox. So i took someones suggestion and when the directive was triggered I added a div to the DOM ... resized that ... and at the end I snapped the original div to the one i added then get rid of the added div.
This actually completely took care of my jitter issue. The only problem is that during the resize event it should be adding a class to the added div which will make it visible on the screen while resizing .... but that class is not added.
My directive is as follows:
directive('resizable', function() {
return {
restrict: 'A',
scope: {
callback: '&onResize'
},
link: function postLink(scope, elem, attrs) {
elem.resizable({
helper: function() {
return (jQuery("<div>").css({
height: jQuery(this).height(),
width: jQuery(this).width()
}).addClass('resizeHelper'));
}
});
elem.on('resizestop', function (evt, ui) {
if (scope.callback) { scope.callback(); }
});
window.e = elem;
}
};
});
The css class i wish to add is:
.resizeHelper {
border: 2px dashed #cccccc;
background: black;
opacity: 0.2;
}
I have setup a plunker to better illustrate the issue im having: http://plnkr.co/edit/Ws64rm?p=preview
If you view source and resize the initial div you will see a class get added that deals with the actual resize event then the original div is snapped to it at the end .... but the css class is never added.