From: philipp Date: Sat, 28 Dec 2013 17:41:00 +0000 (+0000) Subject: Added a minimum width to the sledrun info popup so that hopefully ticket #89 (size... X-Git-Url: https://git.toastfreeware.priv.at/philipp/winterrodeln/mediawiki_extensions/wrmap.git/commitdiff_plain/27c5b687af2992312af59fdd435ea1f556479941 Added a minimum width to the sledrun info popup so that hopefully ticket #89 (size too small on Safari) will be closed. git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/mediawiki_extensions/wrmap/trunk@1850 7aebc617-e5e2-0310-91dc-80fb5f6d2477 --- diff --git a/wrmap.js b/wrmap.js index 1cf1fbe..5bbdcab 100644 --- a/wrmap.js +++ b/wrmap.js @@ -1,5 +1,18 @@ "use strict"; +// "User defined" popup class to be able to specify a minimum size for the popup, +// so that Safari 7.0 displays it correctly (see ticket #89). +OpenLayers.Popup.WrInfo = OpenLayers.Class(OpenLayers.Popup.FramedCloud, { + minSize: new OpenLayers.Size(180, 260), + + initialize: function(id, lonlat, contentSize, contentHTML, anchor, closeBox, closeCallback) { + OpenLayers.Popup.FramedCloud.prototype.initialize.apply(this, arguments); + }, + + CLASS_NAME: "OpenLayers.Popup.WrInfo" +}); + + function init_wrmap(i, jq_map) { // define constants var EPSG4326 = new OpenLayers.Projection("EPSG:4326"); // lon/lat @@ -298,7 +311,7 @@ function init_wrmap(i, jq_map) { // Open popup var selectFeatureControl = this; - var popup = new OpenLayers.Popup.FramedCloud('sledruninfopopup_' + attr.wiki, + var popup = new OpenLayers.Popup.WrInfo('sledruninfopopup_' + attr.wiki, feature.geometry.getBounds().getCenterLonLat(), null, popup_div.html(),