Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored to make the plugin more jQuery compatible and avoid collis…
…ions (use a namespace/object)
- Loading branch information
Dan Pickett
committed
May 21, 2009
1 parent
770e1cb
commit cb04f1b
Showing
2 changed files
with
66 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
jQuery.under_construction = { | ||
hidePendingElements : function() { | ||
jQuery(".pending").each(function(i){ | ||
jQuery(this).addClass("not_visible"); | ||
}); | ||
}, | ||
|
||
showPendingElements : function() { | ||
jQuery(".pending").removeClass("not_visible"); | ||
}, | ||
|
||
hideOverlayOfPendingElements : function() { | ||
jQuery(".overlay_for_pending").remove(); | ||
}, | ||
|
||
overlayPendingElements : function() { | ||
jQuery(".pending").each(function(i){ | ||
|
||
//clone the element so that we can overlay it | ||
var overlay_element = jQuery("<div>"); | ||
|
||
//set the height | ||
var height = jQuery(this).outerHeight(); | ||
var width = jQuery(this).outerWidth(); | ||
|
||
jQuery(overlay_element).height(height); | ||
jQuery(overlay_element).width(width); | ||
|
||
//set the position | ||
var pos = jQuery(this).position(); | ||
|
||
jQuery(overlay_element).css("top", pos.top); | ||
jQuery(overlay_element).css("left", pos.left); | ||
|
||
//add the class that sets opacity and background color | ||
jQuery(overlay_element).addClass("overlay_for_pending"); | ||
|
||
//todo: replace this with a delimited class to indicate what milestone it is | ||
jQuery(overlay_element).html(""); | ||
|
||
//insert after the element in question | ||
jQuery("body").append(overlay_element); | ||
}); | ||
}, | ||
|
||
toggleDisplayOfPendingElements : function() { | ||
if(jQuery(".pending").hasClass("not_visible")) { | ||
this.showPendingElements(); | ||
} | ||
else { | ||
this.hidePendingElements(); | ||
} | ||
}, | ||
|
||
toggleOverlayOfPendingElements : function() { | ||
if(jQuery(".overlay_for_pending").length > 0) { | ||
this.hideOverlayOfPendingElements(); | ||
} | ||
else { | ||
this.overlayPendingElements(); | ||
} | ||
}, | ||
|
||
|
||
} | ||
|
This file was deleted.
Oops, something went wrong.