Ticket #1378: allowSelection.patch
| File allowSelection.patch, 1.5 kB (added by crschmidt, 9 months ago) |
|---|
-
theme/default/style.css
old new 229 229 opacity: 0.50; 230 230 font-size: 1px; 231 231 filter: alpha(opacity=50); 232 } 232 } 233 234 .olControlNoSelect { 235 -moz-user-select: none; 236 } 237 -
lib/OpenLayers/Control.js
old new 79 79 type: null, 80 80 81 81 /** 82 * Property: allowSelection 83 * {Boolean} By deafault, controls do not allow selection, because 84 * it may interfere with map dragging. If this is true, OpenLayers 85 * will not prevent selection of the control. 86 * Default is false. 87 */ 88 allowSelection: false, 89 90 /** 82 91 * Property: displayClass 83 92 * {string} This property is used for CSS related to the drawing of the 84 93 * Control. … … 240 249 if (this.div == null) { 241 250 this.div = OpenLayers.Util.createDiv(this.id); 242 251 this.div.className = this.displayClass; 252 if (!this.allowSelection) { 253 this.div.className += " olControlNoSelect"; 254 this.div.setAttribute("unselectable", "on", 0); 255 this.div.onselectstart = function() { return(false); }; 256 } 243 257 if (this.title != "") { 244 258 this.div.title = this.title; 245 259 }
