Ticket #872: button.patch
| File button.patch, 3.1 kB (added by tschaub, 1 year ago) |
|---|
-
tests/Control/test_Button.html
old new 1 <html> 2 <head> 3 <script src="../../lib/OpenLayers.js"></script> 4 <script type="text/javascript"> 5 function test_Control_Button_constructor (t) { 6 t.plan( 2 ); 7 8 control = new OpenLayers.Control.Button(); 9 t.ok( control instanceof OpenLayers.Control.Button, "new OpenLayers.Control returns object" ); 10 t.eq( control.displayClass, "olControlButton", "displayClass is correct" ); 11 } 12 13 </script> 14 </head> 15 <body> 16 </body> 17 </html> -
tests/list-tests.html
old new 73 73 <li>Tile/test_WFS.html</li> 74 74 <li>test_Control.html</li> 75 75 <li>Control/test_Attribution.html</li> 76 <li>Control/test_Button.html</li> 76 77 <li>Control/test_DragFeature.html</li> 77 78 <li>Control/test_DragPan.html</li> 78 79 <li>Control/test_LayerSwitcher.html</li> -
lib/OpenLayers/Control/Button.js
old new 1 /* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license. 2 * See http://svn.openlayers.org/trunk/openlayers/repository-license.txt 3 * for the full text of the license. */ 4 5 /** 6 * @requires OpenLayers/Control.js 7 */ 8 9 /** 10 * Class: OpenLayers.Control.Button 11 * A very simple button controlfor use with <OpenLayers.Control.Panel>. 12 * When clicked, the function trigger() is executed. 13 * 14 * Inherits from: 15 * - <OpenLayers.Control> 16 * 17 * Use: 18 * (code) 19 * var button = new OpenLayers.Control.Button({ 20 * displayClass: "MyButton", trigger: myFunction 21 * }); 22 * panel.addControls([button]); 23 * (end) 24 * 25 * Will create a button with CSS class MyButtonItemInactive, that 26 * will call the function MyFunction() when clicked. 27 */ 28 OpenLayers.Control.Button = OpenLayers.Class(OpenLayers.Control, { 29 /** 30 * Property: type 31 * {Integer} OpenLayers.Control.TYPE_BUTTON. 32 */ 33 type: OpenLayers.Control.TYPE_BUTTON, 34 35 /* 36 * Method: trigger 37 * Called by a control panel when the button is clicked. 38 */ 39 trigger: function() {}, 40 41 CLASS_NAME: "OpenLayers.Control.Button" 42 }); -
lib/OpenLayers.js
old new 129 129 "OpenLayers/Handler/Keyboard.js", 130 130 "OpenLayers/Control.js", 131 131 "OpenLayers/Control/Attribution.js", 132 "OpenLayers/Control/Button.js", 132 133 "OpenLayers/Control/ZoomBox.js", 133 134 "OpenLayers/Control/ZoomToMaxExtent.js", 134 135 "OpenLayers/Control/DragPan.js",
