Browse Source

Modification to popup to account for changes in transition rewrite

pull/474/head
jlukic 11 years ago
parent
commit
6f4f52c852
2 changed files with 16 additions and 14 deletions
  1. 29
      src/modules/popup.js
  2. 1
      src/modules/popup.less

29
src/modules/popup.js

@ -539,16 +539,16 @@ $.fn.popup = function(parameters) {
module.error(error.recursion); module.error(error.recursion);
searchDepth = 0; searchDepth = 0;
module.reset(); module.reset();
$popup.removeClass(className.loading);
return false; return false;
} }
} }
else { else {
module.debug('Position is on stage', position); module.debug('Position is on stage', position);
searchDepth = 0; searchDepth = 0;
$popup.removeClass(className.loading);
return true; return true;
} }
$module.removeClass(className.loading);
} }
}, },
@ -580,7 +580,7 @@ $.fn.popup = function(parameters) {
is: { is: {
animating: function() { animating: function() {
return ( $popup.is(':animated') || $popup.hasClass(className.transition) );
return ( $popup.is(':animated') || $popup.hasClass(className.animating) );
}, },
visible: function() { visible: function() {
return $popup.is(':visible'); return $popup.is(':visible');
@ -701,13 +701,14 @@ $.fn.popup = function(parameters) {
}, },
invoke: function(query, passedArguments, context) { invoke: function(query, passedArguments, context) {
var var
object = instance,
maxDepth, maxDepth,
found, found,
response response
; ;
passedArguments = passedArguments || queryArguments; passedArguments = passedArguments || queryArguments;
context = element || context; context = element || context;
if(typeof query == 'string' && instance !== undefined) {
if(typeof query == 'string' && object !== undefined) {
query = query.split(/[\. ]/); query = query.split(/[\. ]/);
maxDepth = query.length - 1; maxDepth = query.length - 1;
$.each(query, function(depth, value) { $.each(query, function(depth, value) {
@ -715,22 +716,21 @@ $.fn.popup = function(parameters) {
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1) ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
: query : query
; ;
if( $.isPlainObject( instance[value] ) && (depth != maxDepth) ) {
instance = instance[value];
}
else if( $.isPlainObject( instance[camelCaseValue] ) && (depth != maxDepth) ) {
instance = instance[camelCaseValue];
if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
object = object[camelCaseValue];
} }
else if( instance[value] !== undefined ) {
found = instance[value];
else if( object[camelCaseValue] !== undefined ) {
found = object[camelCaseValue];
return false; return false;
} }
else if( instance[camelCaseValue] !== undefined ) {
found = instance[camelCaseValue];
else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
object = object[value];
}
else if( object[value] !== undefined ) {
found = object[value];
return false; return false;
} }
else { else {
module.error(error.method, query);
return false; return false;
} }
}); });
@ -826,6 +826,7 @@ $.fn.popup.settings = {
}, },
className : { className : {
animating : 'animating',
loading : 'loading', loading : 'loading',
popup : 'ui popup', popup : 'ui popup',
position : 'top left center bottom right', position : 'top left center bottom right',

1
src/modules/popup.less

@ -208,6 +208,7 @@
visibility: hidden; visibility: hidden;
} }
.ui.animating.popup,
.ui.visible.popup { .ui.visible.popup {
display: block; display: block;
} }

Loading…
Cancel
Save