[gnome-maps] placeEntry: Add locEquals function
- From: Jonas Danielsson <jonasdn src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps] placeEntry: Add locEquals function
- Date: Sat, 15 Aug 2015 22:30:36 +0000 (UTC)
commit 9ddf52a4d7d9ad472c2adf07d194b3521ad85e8b
Author: Jonas Danielsson <jonas threetimestwo org>
Date: Sun Aug 16 00:30:04 2015 +0200
placeEntry: Add locEquals function
src/placeEntry.js | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/placeEntry.js b/src/placeEntry.js
index bf954a2..3c4ac2f 100644
--- a/src/placeEntry.js
+++ b/src/placeEntry.js
@@ -34,11 +34,6 @@ const PlaceStore = imports.placeStore;
const SearchPopup = imports.searchPopup;
const Utils = imports.utils;
-Location.Location.prototype.equals = function(location) {
- return (location.latitude === this.latitude &&
- location.longitude === this.longitude);
-};
-
// Matches coordinates string with the format "<lat>, <long>"
const COORDINATES_REGEX = /^\s*(\-?\d+(?:\.\d+)?)\s*,\s*(\-?\d+(?:\.\d+)?)\s*$/;
@@ -58,7 +53,7 @@ const PlaceEntry = new Lang.Class({
if (!this._place && !p)
return;
- if (this._place && p && this._place.location.equals(p.location))
+ if (this._place && p && this._loqEquals(this._place, p))
return;
if (p) {
@@ -135,6 +130,11 @@ const PlaceEntry = new Lang.Class({
}
},
+ _locEquals: function(placeA, placeB) {
+ return (placeA.location.latitude === placeB.location.latitude &&
+ placeA.location.longitude === placeB.location.longitude);
+ },
+
_createPopover: function(numVisible, maxChars) {
let popover = new SearchPopup.SearchPopup({ num_visible: numVisible,
relative_to: this,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]