From b90439d05207c473bb5b8187075be30d8bfbc541 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Thu, 8 Dec 2016 17:32:46 +0500 Subject: Fix parameter removing if it is single --- web/app/controller/Root.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'web') diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js index 87c4cf5..f95dcc6 100644 --- a/web/app/controller/Root.js +++ b/web/app/controller/Root.js @@ -116,7 +116,11 @@ Ext.define('Traccar.controller.Root', { removeUrlParameter: function (param) { var params = Ext.Object.fromQueryString(window.location.search); delete params[param]; - window.history.pushState(null, null, window.location.pathname + '?' + Ext.Object.toQueryString(params)); + if (Ext.Object.isEmpty(params)) { + window.history.pushState(null, null, window.location.pathname); + } else { + window.history.pushState(null, null, window.location.pathname + '?' + Ext.Object.toQueryString(params)); + } }, asyncUpdate: function (first) { -- cgit v1.2.3