summaryrefslogtreecommitdiffstats
path: root/modules-available/roomplanner/js
diff options
context:
space:
mode:
authorSimon Rettberg2017-12-16 18:33:16 +0100
committerSimon Rettberg2017-12-16 18:33:16 +0100
commitcd55ead3e2810e209b726faca12fa749f6875d0f (patch)
tree94b2f29b023e8a0c5100e1d06c974c3c04f890fd /modules-available/roomplanner/js
parentMerge branch 'permission-manager' of openslx.org:openslx-ng/slx-admin into pe... (diff)
downloadslx-admin-cd55ead3e2810e209b726faca12fa749f6875d0f.tar.gz
slx-admin-cd55ead3e2810e209b726faca12fa749f6875d0f.tar.xz
slx-admin-cd55ead3e2810e209b726faca12fa749f6875d0f.zip
Fix A LOT of type problems, logic flaws, uninitialized variables etc.
Most of them were found by phpstorm, so I put in some time and went through the list, fixing quite a bunch of them.
Diffstat (limited to 'modules-available/roomplanner/js')
-rw-r--r--modules-available/roomplanner/js/lib/jquery-collision.js27
1 files changed, 12 insertions, 15 deletions
diff --git a/modules-available/roomplanner/js/lib/jquery-collision.js b/modules-available/roomplanner/js/lib/jquery-collision.js
index 98e37882..eae7ef85 100644
--- a/modules-available/roomplanner/js/lib/jquery-collision.js
+++ b/modules-available/roomplanner/js/lib/jquery-collision.js
@@ -175,11 +175,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{
if( ! inclusive ) inclusive = false;
var epsilon = ( inclusive ? -1 : +1 ) * CollisionCoords.EPSILON;
- if( ( x > ( this.x1 + epsilon ) && x < ( this.x2 - epsilon ) ) &&
- ( y > ( this.y1 + epsilon ) && y < ( this.y2 - epsilon ) ) )
- return true;
- else
- return false;
+ return (x > (this.x1 + epsilon) && x < (this.x2 - epsilon)) &&
+ (y > (this.y1 + epsilon) && y < (this.y2 - epsilon));
};
CollisionCoords.prototype.overlaps = function( other, inclusive )
@@ -189,16 +186,16 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
hit = other._overlaps( this, inclusive );
if( hit.length > 0 )
{
- hit[0].dir = hit[0].dir == "Inside" ? "Outside" :
- hit[0].dir == "Outside" ? "Inside" :
- hit[0].dir == "N" ? "S" :
- hit[0].dir == "S" ? "N" :
- hit[0].dir == "W" ? "E" :
- hit[0].dir == "E" ? "W" :
- hit[0].dir == "NE" ? "SW" :
- hit[0].dir == "SW" ? "NE" :
- hit[0].dir == "SE" ? "NW" :
- hit[0].dir == "NW" ? "SE" :
+ hit[0].dir = hit[0].dir === "Inside" ? "Outside" :
+ hit[0].dir === "Outside" ? "Inside" :
+ hit[0].dir === "N" ? "S" :
+ hit[0].dir === "S" ? "N" :
+ hit[0].dir === "W" ? "E" :
+ hit[0].dir === "E" ? "W" :
+ hit[0].dir === "NE" ? "SW" :
+ hit[0].dir === "SW" ? "NE" :
+ hit[0].dir === "SE" ? "NW" :
+ hit[0].dir === "NW" ? "SE" :
undefined;
}
return hit || [];