public
Fork of sproutit/sproutcore
Description: JavaScript Application Framework - JS library only
Homepage: http://www.sproutcore.com
Clone URL: git://github.com/mauritslamers/sproutcore.git
Adding disabled list item views and checkboxes to the standard CSS. Adjusted 
list item view code to prevent value changing when clicking on a checkbox.
Maurits Lamers (author)
Sun Nov 16 03:08:28 -0800 2008
commit  e6917cb39a730f25a6f3781f45753ca724a7d61f
tree    f4233b7ed81605f82955efd03f03ff5287b567a0
parent  2a85880ad51808aa5a43fefe15b20c93a8519ef1
...
99
100
101
 
102
103
104
...
99
100
101
102
103
104
105
0
@@ -99,6 +99,7 @@
0
   text-overflow: ellipse;
0
 }
0
 
0
+
0
 /* @end */
0
 
0
 /* @group SC.SourceListView */
...
227
228
229
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
230
231
232
...
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
0
@@ -227,6 +227,27 @@ body.sc-theme {
0
 }
0
 
0
 
0
+
0
+
0
+/* checkboxes inside list item views */
0
+
0
+.sc-theme .sc-list-item-view.disabled {
0
+  color: #887F7F;  
0
+}
0
+
0
+.sc-theme .sc-list-item-view.disabled a.checkbox img.button {
0
+  background: static_url('images/sc-theme-sprite.png') no-repeat 0 -760px;
0
+} 
0
+
0
+.sc-theme .sc-list-item-view.disabled a.checkbox.sel img.button {
0
+  background: static_url('images/sc-theme-sprite.png') no-repeat -32px -792px;
0
+}
0
+
0
+.sc-theme .sc-list-item-view.disabled a.checkbox.mixed img.button {
0
+  background: static_url('images/sc-theme-sprite.png') no-repeat 0 -760px;
0
+}
0
+
0
+
0
 /* @end */
0
 
0
 /* @group SC.SplitView */
...
188
189
190
191
 
192
193
194
...
317
318
319
320
321
322
323
 
 
 
 
 
324
325
326
327
328
329
330
 
 
331
332
333
...
340
341
342
343
 
344
345
346
...
188
189
190
 
191
192
193
194
...
317
318
319
 
 
 
 
320
321
322
323
324
325
326
327
328
 
 
 
329
330
331
332
333
...
340
341
342
 
343
344
345
346
0
@@ -188,7 +188,7 @@ SC.ListItemView = SC.View.extend(SC.Control, SC.InlineEditorDelegate,
0
       ret = SC.ListItemView._selectedCheckboxHtml ;
0
       if (!ret) {
0
         ret = SC.CheckboxView.prototype.emptyElement ;
0
-        ret = ret.replace('class="', 'class="sel ') ;
0
+        ret = ret.replace('class="', 'class="sel ') ; 
0
         SC.ListItemView._selectedCheckboxHtml = ret ;
0
       }
0
     } else {
0
@@ -317,17 +317,17 @@ SC.ListItemView = SC.View.extend(SC.Control, SC.InlineEditorDelegate,
0
     button.
0
    */
0
    mouseDown: function(evt) {
0
-     var del = this.displayDelegate ;
0
-     var checkboxKey = this.getDelegateProperty(del, 'contentCheckboxKey') ;
0
-     if (checkboxKey) {
0
-       if (this._isInsideElementWithClassName('sc-checkbox-view', evt)) {
0
+
0
+      var del = this.displayDelegate ;
0
+      var checkboxKey = this.getDelegateProperty(del, 'contentCheckboxKey') ;
0
+      if (checkboxKey) {
0
+         if (this._isInsideElementWithClassName('sc-checkbox-view', evt)) {
0
          this._addCheckboxActiveState() ;
0
          this._isMouseDownOnCheckbox = YES ;
0
          this._isMouseInsideCheckbox = YES ;
0
          return true ;
0
-       }
0
-     }  
0
-     
0
+         }
0
+      }   
0
      return false ; // otherwise let normal handlers do it...
0
    },
0
 
0
@@ -340,7 +340,7 @@ SC.ListItemView = SC.View.extend(SC.Control, SC.InlineEditorDelegate,
0
          var del = this.displayDelegate ;
0
          var checkboxKey = this.getDelegateProperty(del, 'contentCheckboxKey') ;
0
          var content = this.get('content') ;
0
-         if (content && content.get) {
0
+         if (content && content.get && this.get('isEnabled')) {
0
            var value = content.get(checkboxKey) ;
0
            value = (value === SC.MIXED_STATE) ? YES : !value ;
0
            content.set(checkboxKey, value) ;
...
1433
1434
1435
 
 
 
 
 
 
 
 
1436
1437
1438
...
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
0
@@ -1433,6 +1433,14 @@ SC.View = SC.Responder.extend(SC.PathModule,  SC.DelegateSupport,
0
     this.viewFrameDidChange(YES) ;
0
   },
0
   
0
+  recomputeClippingFrame: function() {
0
+    this.recacheFrames();
0
+    var parent = this.parentNode;
0
+    while (parent) {
0
+      parent.recacheFrames();
0
+      parent = parent.parentNode;
0
+    }
0
+  },
0
   /** @private
0
     Handler for the onscroll event.  Hooked in on init if isScrollable is 
0
     true.  Notify children that their clipping frame has changed.

Comments