From f67ff109212684fb9cc28ffb518370ec2ab2458a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Tue, 29 Nov 2016 17:33:08 +0100 Subject: [PATCH] Fix export and version comparison MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- .../addressBook/addressBook_controller.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/js/components/addressBook/addressBook_controller.js b/js/components/addressBook/addressBook_controller.js index 636f09e92..05bbc2f26 100644 --- a/js/components/addressBook/addressBook_controller.js +++ b/js/components/addressBook/addressBook_controller.js @@ -4,8 +4,22 @@ angular.module('contactsApp') ctrl.showUrl = false; /* globals oc_config */ + + function compareVersion(version1, version2) { + var result=false; + for(var i=0;i<(Math.max(version1.length, version2.length));i++) { + if(Number(version1[i])= [9, 0, 2, 0]; + ctrl.canExport = compareVersion([9, 0, 2, 0], oc_config.version.split('.')); /* eslint-enable camelcase */ ctrl.toggleShowUrl = function() {