Permalink
Browse files

Remove whitespace

  • Loading branch information...
1 parent 4c7b544 commit 5a1218442a1d0aa3c632f896e8bff08f9a44e7a7 @publickeating publickeating committed Aug 31, 2011
Showing with 60 additions and 60 deletions.
  1. +23 −23 frameworks/desktop/views/select.js
  2. +37 −37 frameworks/foundation/views/label.js
@@ -15,7 +15,7 @@ sc_require('views/button');
Clicking the SelectView button displays a menu pane with a
list of items. The selected item will be displayed on the button.
User has the option of enabling checkbox for the selected menu item.
-
+
@extends SC.ButtonView
@version 1.0
@author Alex Iskander, Mohammed Ashik
@@ -80,15 +80,15 @@ SC.SelectView = SC.ButtonView.extend(
@default null
*/
itemIconKey: null,
-
+
/**
Key to use to identify separators.
@type String
@default "separator"
*/
itemSeparatorKey: "separator",
-
+
/**
Key used to indicate if the item is to be enabled.
@@ -121,7 +121,7 @@ SC.SelectView = SC.ButtonView.extend(
/**
Menu attached to the SelectView.
-
+
@type SC.View
@default SC.MenuView
*/
@@ -208,7 +208,7 @@ SC.SelectView = SC.ButtonView.extend(
/**
The button theme will be popup
-
+
@type String
@default 'popup'
@readOnly
@@ -268,15 +268,15 @@ SC.SelectView = SC.ButtonView.extend(
/**
Example view used for menu items.
-
+
@type SC.View
@default null
*/
exampleView: null,
-
+
/**
customView menu offset width
-
+
@type Number
@default 0
*/
@@ -298,26 +298,26 @@ SC.SelectView = SC.ButtonView.extend(
@default 0
*/
menuPaneHeightPadding: 0,
-
+
/**
The amount of space to add to the calculated width of the menu item strings to
determine the width of the menu pane.
-
+
@type Number
@default 35
*/
menuItemPadding: 35,
-
+
/**
@type Boolean
@default NO
*/
isContextMenuEnabled: NO,
-
+
/**
- This is a property to enable/disable focus rings in buttons.
+ This is a property to enable/disable focus rings in buttons.
For select_button, we are making it a default.
-
+
@type Boolean
@default YES
@see SC.ButtonView#supportFocusRing
@@ -462,11 +462,11 @@ SC.SelectView = SC.ButtonView.extend(
else {
isChecked = NO ;
}
-
+
// Check if the item is enabled
itemEnabled = (object.get ? object.get(isEnabledKey) : object[isEnabledKey]);
if (NO !== itemEnabled) itemEnabled = YES;
-
+
// get the separator
isSeparator = separatorKey ? (object.get ? object.get(separatorKey) : object[separatorKey]) : NO;
@@ -477,7 +477,7 @@ SC.SelectView = SC.ButtonView.extend(
this._defaultIcon = icon ;
}
- var item = SC.Object.create({
+ item = SC.Object.create({
separator: isSeparator,
title: name,
icon: icon,
@@ -552,7 +552,7 @@ SC.SelectView = SC.ButtonView.extend(
}
// Get the length of the text on the button in pixels
menuWidth = this.get('layer').offsetWidth + menuWidthOffset ;
-
+
// Get the length of the text on the button in pixels
menuWidth = this.get('layer').offsetWidth ;
scrollWidth = buttonLabel.scrollWidth ;
@@ -574,7 +574,7 @@ SC.SelectView = SC.ButtonView.extend(
var customViewMenuOffsetWidth = this.get('customViewMenuOffsetWidth') ;
var className = 'sc-view sc-pane sc-panel sc-palette sc-picker sc-menu select-button sc-scroll-view sc-menu-scroll-view sc-container-view menuContainer sc-button-view sc-menu-item sc-regular-size' ;
className = customViewClassName ? (className + ' ' + customViewClassName) : className ;
-
+
SC.prepareStringMeasurement("", className);
for (idx = 0, itemsLength = items.length; idx < itemsLength; ++idx) {
//getting the width of largest menu item
@@ -665,7 +665,7 @@ SC.SelectView = SC.ButtonView.extend(
*/
displaySelectedItem: function(menuView) {
var currentItem = menuView.get("selectedItem");
-
+
this.set("value", currentItem.get("value"));
this.set("title", currentItem.get("title"));
this.set("_itemIdx", currentItem.get("contentIndex"));
@@ -782,7 +782,7 @@ SC.SelectView = SC.ButtonView.extend(
mouseExited: function() {
return YES;
},
-
+
/**
@private
Handle Key event - Down arrow key
@@ -811,13 +811,13 @@ SC.SelectView = SC.ButtonView.extend(
}
return sc_super();
},
-
+
/** @private
Override the button isSelectedDidChange function in order to not perform any action
on selecting the select_button
*/
_button_isSelectedDidChange: function() {
-
+
}.observes('isSelected')
}) ;
@@ -13,12 +13,12 @@ SC.REGULAR_WEIGHT = 'normal';
SC.BOLD_WEIGHT = 'bold';
/**
@class
-
+
Displays a static string of text.
-
- You use a label view anytime you need to display a static string of text
+
+ You use a label view anytime you need to display a static string of text
or to display text that may need to be edited using only an inline control.
-
+
@extends SC.View
@extends SC.Control
@extends SC.InlineEditable
@@ -42,30 +42,30 @@ SC.LabelView = SC.View.extend(SC.Control, SC.InlineEditable,
inlineEditorDelegate: SC.InlineTextFieldDelegate,
isEditable: NO,
-
+
/**
- The exampleInlineTextFieldView property is by default a
+ The exampleInlineTextFieldView property is by default a
SC.InlineTextFieldView but it can be set to a customized inline text field
view.
-
+
@property
@type {SC.View}
@default {SC.InlineTextFieldView}
*/
exampleEditor: SC.InlineTextFieldView,
-
+
/**
Specify the font weight for this. You may pass SC.REGULAR_WEIGHT, or SC.BOLD_WEIGHT.
-
+
@property {String} SC.REGULAR_WEIGHT|SC.BOLD_WEIGHT
@default null
@deprecated Use CSS instead.
*/
fontWeight: null,
-
+
/**
If true, value will be escaped to avoid scripting attacks.
-
+
This is a default value that can be overridden by the
settings on the owner view.
*/
@@ -78,25 +78,25 @@ SC.LabelView = SC.View.extend(SC.Control, SC.InlineEditable,
*/
localize: NO,
localizeBindingDefault: SC.Binding.oneWay().bool(),
-
+
/**
Set this to a validator or to a function and the value
will be passed through it before being set.
-
+
This is a default default that can be overidden by the
settings in the owner view.
*/
formatter: null,
- /**
+ /**
The value of the label.
-
+
You may also set the value using a content object and a contentValueKey.
-
+
@field {String}
*/
value: '',
-
+
/**
The hint to display if no value is set. Should be used only if isEditable
is set to YES.
@@ -108,10 +108,10 @@ SC.LabelView = SC.View.extend(SC.Control, SC.InlineEditable,
to either a CSS class name (for spriting) or an image URL.
*/
icon: null,
-
+
/**
Set the alignment of the label view.
-
+
@property {String} SC.ALIGN_LEFT|SC.ALIGN_CENTER|SC.ALIGN_RIGHT
@default null
@deprecated Use CSS instead.
@@ -139,26 +139,26 @@ SC.LabelView = SC.View.extend(SC.Control, SC.InlineEditable,
/**
[RO] The value that will actually be displayed.
-
- This property is dynamically computed by applying localization,
+
+ This property is dynamically computed by applying localization,
string conversion and other normalization utilities.
-
+
@field
*/
displayTitle: function() {
var value, formatter;
-
+
value = this.get('value') ;
-
+
// 1. apply the formatter
formatter = this.getDelegateProperty('formatter', this.displayDelegate) ;
if (formatter) {
- var formattedValue = (SC.typeOf(formatter) === SC.T_FUNCTION) ?
+ var formattedValue = (SC.typeOf(formatter) === SC.T_FUNCTION) ?
formatter(value, this) : formatter.fieldValueForObject(value, this) ;
if (!SC.none(formattedValue)) value = formattedValue ;
}
-
- // 2. If the returned value is an array, convert items to strings and
+
+ // 2. If the returned value is an array, convert items to strings and
// join with commas.
if (SC.typeOf(value) === SC.T_ARRAY) {
var ary = [];
@@ -169,35 +169,35 @@ SC.LabelView = SC.View.extend(SC.Control, SC.InlineEditable,
}
value = ary.join(',') ;
}
-
+
// 3. If value is not a string, convert to string. (handles 0)
if (!SC.none(value) && value.toString) value = value.toString() ;
-
+
// 4. Localize
if (value && this.getDelegateProperty('localize', this.displayDelegate)) value = SC.String.loc(value) ;
-
+
return value ;
}.property('value', 'localize', 'formatter').cacheable(),
-
-
+
+
/**
[RO] The hint value that will actually be displayed.
-
- This property is dynamically computed by applying localization
+
+ This property is dynamically computed by applying localization
and other normalization utilities.
-
+
*/
hintValue: function() {
var hintVal = this.get('hint');
return hintVal ;
}.property('hint').cacheable(),
-
+
/**
Event dispatcher callback.
If isEditable is set to true, opens the inline text editor view.
@param {DOMMouseEvent} evt DOM event
-
+
*/
doubleClick: function( evt ) { return this.beginEditing(); },

0 comments on commit 5a12184

Please sign in to comment.