Skip to content

Commit

Permalink
Merge branch 'release-2.4.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
archetyped committed Jul 14, 2015
2 parents 5c24a69 + 59c2d7f commit 65863c3
Show file tree
Hide file tree
Showing 13 changed files with 212 additions and 162 deletions.
2 changes: 1 addition & 1 deletion client/css/admin.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/css/app.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions client/js/dev/lib.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -632,11 +632,16 @@ var Utilities = {
break;
case 'object':
if ( !$.isPlainObject(value) ) {
// Custom object. Unable to evaluate emptiness further
ret = false;
} else {
// Evaluate plain object
if ( Object.getOwnPropertyNames ) {
// Modern browser check
ret = ( Object.getOwnPropertyNames(value).length === 0 );
} else if ( value.hasOwnProperty ) {
// Legacy browser check
ret = true;
for ( var key in value ) {
if ( value.hasOwnProperty(key) ) {
ret = false;
Expand Down
21 changes: 17 additions & 4 deletions client/js/dev/lib.view.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ var View = {
* @return bool TRUE if default component instance creation is allowed
*/
can_make_default_component: function(type) {
return ( -1 !== this.component_defaults.indexOf(type) );
return ( -1 !== $.inArray(type, this.component_defaults) );
},

/**
Expand Down Expand Up @@ -2558,7 +2558,10 @@ var Group = {
* Retrieve group items
*/
get_items: function() {
var items = ( !this.util.is_empty(this.get_id()) ) ? $(this.get_selector()) : this.get_current().dom_get();
var items = $(this.get_selector());
if ( 0 === items.length && this.has_current() ) {
items = this.get_current().dom_get();
}
return items;
},

Expand Down Expand Up @@ -2596,14 +2599,24 @@ var Group = {
}
return ( this.util.is_type(item, View.Content_Item) ) ? this.get_items().index(item.dom_get()) : -1;
},

/**
* Check if current item set in group
* @return bool TRUE if current item is set
*/
has_current: function() {
// Sanitize
return ( !this.util.is_empty( this.get_current() ) );
},

/**
* Retrieve current item
* @return Content_Item Current item
* @uses Group.current
* @return NULL|Content_Item Current item (NULL if current item not set or invalid)
*/
get_current: function() {
// Sanitize
if ( !this.util.is_empty(this.current) && !this.util.is_type(this.current, View.Content_Item) ) {
if ( null !== this.current && !this.util.is_type(this.current, View.Content_Item) ) {
this.current = null;
}
return this.current;
Expand Down
2 changes: 1 addition & 1 deletion client/js/prod/lib.core.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions client/js/prod/lib.view.js

Large diffs are not rendered by default.

Loading

0 comments on commit 65863c3

Please sign in to comment.