@@ -23,6 +23,8 @@ var SSNotifierView = new Class({
23
23
SSAddObserver ( this , 'onSpaceMenuHide' , this . onSpaceMenuHide . bind ( this ) ) ;
24
24
SSAddObserver ( this , 'onNewShiftSave' , this . onNewShiftSave . bind ( this ) ) ;
25
25
SSAddObserver ( this , 'onShiftEdit' , this . onShiftEdit . bind ( this ) ) ;
26
+ SSAddObserver ( this , 'onShiftHide' , this . onShiftHide . bind ( this ) ) ;
27
+ SSAddObserver ( this , 'onShiftDestroy' , this . onShiftDestroy . bind ( this ) ) ;
26
28
SSAddObserver ( this , 'onShiftLeaveEdit' , this . onShiftLeaveEdit . bind ( this ) ) ;
27
29
SSAddObserver ( this , 'onShiftCheck' , this . onShiftCheck . bind ( this ) ) ;
28
30
SSAddObserver ( this , 'onShiftUncheck' , this . onShiftUncheck . bind ( this ) ) ;
@@ -79,8 +81,9 @@ var SSNotifierView = new Class({
79
81
} ,
80
82
81
83
82
- onShiftEdit : function ( )
84
+ onShiftEdit : function ( shiftId )
83
85
{
86
+ SSLog ( "onShiftEdit" , shiftId , SSLogForce ) ;
84
87
this . fireEvent ( 'edit' ) ;
85
88
} ,
86
89
@@ -91,6 +94,16 @@ var SSNotifierView = new Class({
91
94
} ,
92
95
93
96
97
+ onShiftHide : function ( shiftId )
98
+ {
99
+ } ,
100
+
101
+
102
+ onShiftDestroy : function ( shiftId )
103
+ {
104
+ } ,
105
+
106
+
94
107
currentListView : function ( )
95
108
{
96
109
return this . __currentListView ;
@@ -420,12 +433,17 @@ var SSNotifierView = new Class({
420
433
421
434
this . SSQPCancel . addEvent ( "click" , function ( evt ) {
422
435
evt = new Event ( evt ) ;
423
- var id = this . currentListView ( ) . checkedItemIds ( ) [ 0 ] ;
424
- if ( SSIsNewShift ( id ) )
436
+ var itemIds = ( this . currentListView ( ) ) ? this . currentListView ( ) . checkedItemIds ( ) : [ ] ;
437
+ if ( itemIds . length == 0 && this . __newShiftId )
425
438
{
439
+ // NOTE: might be breaking encapsulation a little too much - David 9/5/10
440
+ SSGetShiftInstance ( this . __newShiftId ) . destroy ( ) ;
441
+ this . hideQuickPane ( ) ;
426
442
}
427
443
else
428
444
{
445
+ SSLog ( "showQuickEditPane" , SSLogForce ) ;
446
+ var id = itemIds [ 0 ] ;
429
447
SSEditExitShift ( SSSpaceForShift ( id ) , id ) ;
430
448
this . hideQuickPane ( ) ;
431
449
this . showQuickEditPane ( ) ;
@@ -441,10 +459,12 @@ var SSNotifierView = new Class({
441
459
442
460
this . SSQEPEdit . addEvent ( "click" , function ( evt ) {
443
461
evt = new Event ( evt ) ;
444
- var id = this . currentListView ( ) . checkedItemIds ( ) [ 0 ] ;
462
+ var id = this . currentListView ( ) . checkedItemIds ( ) [ 0 ] ,
463
+ idx = this . currentListView ( ) . checkedItemIndices ( ) [ 0 ] ;
445
464
SSEditShift ( SSSpaceForShift ( id ) , id ) ;
446
465
this . hideQuickEditPane ( ) ;
447
466
this . showQuickPane ( SSGetShift ( id ) ) ;
467
+ this . currentListView ( ) . selectRow ( idx ) ;
448
468
} . bind ( this ) ) ;
449
469
450
470
this . SSQEPShare . addEvent ( "click" , function ( evt ) {
@@ -455,6 +475,7 @@ var SSNotifierView = new Class({
455
475
this . SSQEPDelete . addEvent ( "click" , function ( evt ) {
456
476
evt = new Event ( evt ) ;
457
477
var ids = this . currentListView ( ) . checkedItemIds ( ) ;
478
+
458
479
ids . each ( $comp ( SSDeleteShift , $msg ( 'realize' ) ) ) ;
459
480
} . bind ( this ) ) ;
460
481
} ,
@@ -663,6 +684,7 @@ var SSNotifierView = new Class({
663
684
664
685
onNewShiftShow : function ( id , status )
665
686
{
687
+ this . __newShiftId = id ;
666
688
this . showQuickPane ( SSGetShift ( id ) ) ;
667
689
} ,
668
690
@@ -692,6 +714,12 @@ var SSNotifierView = new Class({
692
714
{
693
715
this . SSQuickPane . addClass ( "SSDisplayNone" ) ;
694
716
} ,
717
+
718
+
719
+ isQuickPaneVisible : function ( )
720
+ {
721
+ return ! this . SSQuickPane . hasClass ( "SSDisplayNone" ) ;
722
+ } ,
695
723
696
724
697
725
showQuickEditPane : function ( )
@@ -705,6 +733,12 @@ var SSNotifierView = new Class({
705
733
this . SSQuickEditPane . addClass ( "SSDisplayNone" ) ;
706
734
} ,
707
735
736
+
737
+ isQuickEditPaneVisible : function ( args )
738
+ {
739
+ return ! this . SSQuickEditPane . hasClass ( "SSDisplayNone" ) ;
740
+ } ,
741
+
708
742
709
743
buildInterface : function ( )
710
744
{
0 commit comments