@@ -186,16 +186,16 @@ angular.module('sm').directive('schedule', function($timeout, $filter) {
186186 pre : function ( scope , elm , attrs ) {
187187 scope . scheduleController = new Schedule ( scope ) ;
188188 scope . itemEnter = function ( $event ) {
189- $target = $ ( $event . target ) ;
190- $scope = $target . scope ( ) ;
189+ var $target = $ ( $event . target ) ,
190+ $scope = $target . scope ( ) ;
191191 if ( $scope . item . boundry . height < 70 ) {
192192 $scope . item . boundry . orig_height = $scope . item . boundry . height ;
193193 $scope . item . boundry . height = 70 ;
194194 }
195195 } ;
196196 scope . itemLeave = function ( $event ) {
197- $target = $ ( $event . target ) ;
198- $scope = $target . scope ( ) ;
197+ var $target = $ ( $event . target ) ,
198+ $scope = $target . scope ( ) ;
199199 if ( $scope . item . boundry . orig_height ) {
200200 $scope . item . boundry . height = $scope . item . boundry . orig_height ;
201201 }
@@ -221,25 +221,22 @@ angular.module('sm').directive('schedule', function($timeout, $filter) {
221221 // Only redraw if valid options
222222 scope . scheduleController . draw ( ) ;
223223
224- // Fix pixel alignment issues
225- $timeout ( function ( ) {
226- var offset = elm . find ( "svg" ) . offset ( ) ,
227- vert = 1 - parseFloat ( '0.' + ( '' + offset . top ) . split ( '.' ) [ 1 ] ) ;
228- horz = 1 - parseFloat ( '0.' + ( '' + offset . left ) . split ( '.' ) [ 1 ] ) ;
229- scope . grid . opts . pixelAlignment = 'translate(' + horz + ',' + vert + ')' ;
230-
231- // Everything is dumb
232- //if(window.chrome) {
233- var svg = $ ( elm ) . find ( 'svg' ) ;
234- svg . hide ( ) ;
235- setTimeout ( function ( ) {
236- svg . show ( ) ;
237- } , 0 ) ;
238- //}
239- } , 10 , true ) ;
240-
224+ // Fix pixel alignment issues
225+ $timeout ( function ( ) {
226+ var offset = elm . find ( "svg" ) . offset ( ) ,
227+ vert = 1 - parseFloat ( '0.' + ( '' + offset . top ) . split ( '.' ) [ 1 ] ) ;
228+ horz = 1 - parseFloat ( '0.' + ( '' + offset . left ) . split ( '.' ) [ 1 ] ) ;
229+ scope . grid . opts . pixelAlignment = 'translate(' + horz + ',' + vert + ')' ;
230+
231+ // Toggle showing and hiding svgs, which forces a redraw
232+ var svg = $ ( elm ) . find ( 'svg' ) ;
233+ svg . hide ( ) ;
234+ setTimeout ( function ( ) {
235+ svg . show ( ) ;
236+ } , 0 ) ;
237+ } , 10 , true ) ;
241238 }
242- }
239+ } ;
243240
244241 if ( ! scope . overrideDrawOptions ) {
245242 scope . $watchCollection ( 'state.drawOptions' , update ) ;
0 commit comments