1 sc_require("views/view"); 2 3 SC.View.reopen( 4 /** @scope SC.View.prototype */ { 5 6 /** 7 You can set this to an SC.Cursor instance; whenever that SC.Cursor's 8 'cursorStyle' changes, the cursor for this view will automatically 9 be updated to match. This allows you to coordinate the cursors of 10 many views by making them all share the same cursor instance. 11 12 For example, SC.SplitView uses this ensure that it and all of its 13 children have the same cursor while dragging, so that whether you are 14 hovering over the divider or another child of the split view, the 15 proper cursor is visible. 16 17 @property {SC.Cursor String} 18 */ 19 cursor: function(key, value) { 20 var parent; 21 22 if (value) { this._setCursor = value; } 23 if (this._setCursor !== undefined) { return this._setCursor; } 24 25 parent = this.get('parentView'); 26 if (this.get('shouldInheritCursor') && parent) { 27 return parent.get('cursor'); 28 } 29 30 return null; 31 }.property('parentView', 'shouldInheritCursor').cacheable(), 32 33 /** 34 A child view without a cursor of its own inherits its parent's cursor by 35 default. Set this to NO to prevent this behavior. 36 37 @type Boolean 38 */ 39 shouldInheritCursor: YES 40 41 }); 42