source: main/trunk/greenstone3/web/interfaces/oran/js/jquery-ui-1.8rc1/ui/minified/jquery.ui.position.min.js@ 24245

Last change on this file since 24245 was 24245, checked in by sjb48, 13 years ago

Oran code for supporting format changes to document.

  • Property svn:executable set to *
File size: 3.1 KB
Line 
1/*
2 * jQuery UI Position 1.8rc1
3 *
4 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
5 * Dual licensed under the MIT (MIT-LICENSE.txt)
6 * and GPL (GPL-LICENSE.txt) licenses.
7 *
8 * http://docs.jquery.com/UI/Position
9 */
10(function(f){f.ui=f.ui||{};var c=/left|center|right/,e="center",d=/top|center|bottom/,g="center",a=f.fn.position;f.fn.position=function(i){if(!i||!i.of){return a.apply(this,arguments)}i=f.extend({},i);var l=f(i.of),n=(i.collision||"flip").split(" "),m=i.offset?i.offset.split(" "):[0,0],k,h,j;if(i.of.nodeType===9){k=l.width();h=l.height();j={top:0,left:0}}else{if(i.of.scrollTo&&i.of.document){k=l.width();h=l.height();j={top:l.scrollTop(),left:l.scrollLeft()}}else{if(i.of.preventDefault){i.at="left top";k=h=0;j={top:i.of.pageY,left:i.of.pageX}}else{k=l.outerWidth();h=l.outerHeight();j=l.offset()}}}f.each(["my","at"],function(){var o=(i[this]||"").split(" ");o=o.length==1?c.test(o[0])?o.concat([g]):d.test(o[0])?[e].concat(o):[e,g]:o;o[0]=c.test(o[0])?o[0]:e;o[1]=d.test(o[1])?o[1]:g;i[this]=o});if(n.length==1){n[1]=n[0]}m[0]=parseInt(m[0],10)||0;if(m.length==1){m[1]=m[0]}m[1]=parseInt(m[1],10)||0;switch(i.at[0]){case"right":j.left+=k;break;case e:j.left+=k/2;break}switch(i.at[1]){case"bottom":j.top+=h;break;case g:j.top+=h/2;break}j.left+=m[0];j.top+=m[1];return this.each(function(){var t=f(this),s=t.outerWidth(),r=t.outerHeight(),p=f.extend({},j),u,o,q;switch(i.my[0]){case"right":p.left-=s;break;case e:p.left-=s/2;break}switch(i.my[1]){case"bottom":p.top-=r;break;case g:p.top-=r/2;break}f.each(["left","top"],function(w,v){(f.ui.position[n[w]]&&f.ui.position[n[w]][v](p,{targetWidth:k,targetHeight:h,elemWidth:s,elemHeight:r,offset:m,my:i.my,at:i.at}))});(f.fn.bgiframe&&t.bgiframe());t.offset(f.extend(p,{using:i.using}))})};f.ui.position={fit:{left:function(h,i){var j=h.left+i.elemWidth-f(window).width()-f(window).scrollLeft();h.left=j>0?h.left-j:Math.max(0,h.left)},top:function(h,i){var j=h.top+i.elemHeight-f(window).height()-f(window).scrollTop();h.top=j>0?h.top-j:Math.max(0,h.top)}},flip:{left:function(i,j){if(j.at[0]=="center"){return}var k=i.left+j.elemWidth-f(window).width()-f(window).scrollLeft(),h=j.my[0]=="left"?-j.elemWidth:j.my[0]=="right"?j.elemWidth:0,l=-2*j.offset[0];i.left+=i.left<0?h+j.targetWidth+l:k>0?h-j.targetWidth+l:0},top:function(i,k){if(k.at[1]=="center"){return}var l=i.top+k.elemHeight-f(window).height()-f(window).scrollTop(),h=k.my[1]=="top"?-k.elemHeight:k.my[1]=="bottom"?k.elemHeight:0,j=k.at[1]=="top"?k.targetHeight:-k.targetHeight,m=-2*k.offset[1];i.top+=i.top<0?h+k.targetHeight+m:l>0?h+j+m:0}}};if(!f.offset.setOffset){f.offset.setOffset=function(l,i){if(/static/.test(jQuery.curCSS(l,"position"))){l.style.position="relative"}var k=jQuery(l),n=k.offset(),h=parseInt(jQuery.curCSS(l,"top",true),10)||0,m=parseInt(jQuery.curCSS(l,"left",true),10)||0,j={top:(i.top-n.top)+h,left:(i.left-n.left)+m};if("using" in i){i.using.call(l,j)}else{k.css(j)}};var b=f.fn.offset;f.fn.offset=function(h){var i=this[0];if(!i||!i.ownerDocument){return null}if(h){return this.each(function(){f.offset.setOffset(this,h)})}return b.call(this)}}})(jQuery);
Note: See TracBrowser for help on using the repository browser.