From aba561487f516cf01bdd529df32313bad7e9800a Mon Sep 17 00:00:00 2001
From: blavenie <benoit.lavenier@e-is.pro>
Date: Mon, 19 Sep 2016 12:21:11 +0200
Subject: [PATCH] - Add Math.trunc() if missing on platform - fix #144

---
 www/js/app.js                             | 10 +++++++++-
 www/plugins/es/templates/menu_extend.html |  4 ++--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/www/js/app.js b/www/js/app.js
index 17ae6ae47..4110324c3 100644
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -246,8 +246,16 @@ angular.module('cesium', ['ionic', 'ionic-material', 'ngMessages', 'ngAnimate',
 
 // Workaround to add startsWith() if not present
 if (typeof String.prototype.startsWith !== 'function') {
-  console.log("Adding String.prototype.startsWith() -> was missing on this platform");
+  console.debug("Adding String.prototype.startsWith() -> was missing on this platform");
   String.prototype.startsWith = function(prefix) {
       return this.indexOf(prefix) === 0;
   };
 }
+
+// Workaround to add Math.trunc() if not present - fix #144
+if (Math && typeof Math.trunc !== 'function') {
+  console.debug("Adding Math.trunc() -> was missing on this platform");
+  Math.trunc = function(number) {
+    return (number - 0.5).toFixed();
+  };
+}
diff --git a/www/plugins/es/templates/menu_extend.html b/www/plugins/es/templates/menu_extend.html
index 2df8c5a6d..bfe590434 100644
--- a/www/plugins/es/templates/menu_extend.html
+++ b/www/plugins/es/templates/menu_extend.html
@@ -7,7 +7,7 @@
             href="#/app/registry"
             active-link="active"
             active-link-path-prefix="#/app/registry"
-            ng-click="showRegistryLookupView(); return false;">
+            ng-click="showRegistryLookupView();">
     <i class="icon ion-ios-book"></i>
     <span translate>MENU.REGISTRY</span>
   </ion-item>
@@ -17,7 +17,7 @@
             href="#/app/market"
             active-link="active"
             active-link-path-prefix="#/app/market"
-            ng-click="showMarketLookupView(); return false;">
+            ng-click="showMarketLookupView();">
     <i class="icon ion-speakerphone"></i>
     <span translate>MENU.MARKET</span>
   </ion-item>
-- 
GitLab