removed overlayplacement.js and moved it's only relevant object literal directly into overlay.js

This commit is contained in:
thatcher 2011-12-13 17:38:36 -05:00
parent 7cac08a2f4
commit 97d2f0c765
2 changed files with 113 additions and 117 deletions

View File

@ -1,14 +1,30 @@
(function( $ ){
$.OverlayPlacement = {
CENTER: 0,
TOP_LEFT: 1,
TOP: 2,
TOP_RIGHT: 3,
RIGHT: 4,
BOTTOM_RIGHT: 5,
BOTTOM: 6,
BOTTOM_LEFT: 7,
LEFT: 8
};
$.Overlay = function(elmt, loc, placement) {
this.elmt = elmt;
this.scales = (loc instanceof $.Rect);
this.bounds = new $.Rect(loc.x, loc.y, loc.width, loc.height);
this.placement = loc instanceof $.Point ? placement : $.OverlayPlacement.TOP_LEFT; // rects are always top-left
this.position = new $.Point(loc.x, loc.y);
this.size = new $.Point(loc.width, loc.height);
this.style = elmt.style;
// rects are always top-left
this.placement = loc instanceof $.Point ?
placement :
$.OverlayPlacement.TOP_LEFT;
};
$.Overlay.prototype = {

View File

@ -1,20 +0,0 @@
(function( $ ){
$.OverlayPlacement = function() {
throw Error.invalidOperation();
};
$.OverlayPlacement = {
CENTER: 0,
TOP_LEFT: 1,
TOP: 2,
TOP_RIGHT: 3,
RIGHT: 4,
BOTTOM_RIGHT: 5,
BOTTOM: 6,
BOTTOM_LEFT: 7,
LEFT: 8
};
}( OpenSeadragon ));