OpenLayers OpenLayers

Ticket #788 (closed bug: fixed)

Opened 1 year ago

Last modified 1 year ago

Control displayClass is not correct if CLASS_NAME contains >= 2 periods

Reported by: fredj Assigned to:
Priority: minor Milestone: 2.5 Release
Component: Control Version: SVN
Keywords: Cc:
State:

Description

From Glen Stampoultzis (to the dev mailing list):

In Control.js:

    /**
     * @constructor
     *
     * @param {Object} options
     */
    initialize: function (options) {
        // We do this before the extend so that instances can override
        // className in options.
        this.displayClass = this.CLASS_NAME.replace("OpenLayers.", "ol").replace(".","");

        OpenLayers.Util.extend(this, options);

        this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_");
    },


the replace only replaces the first period. Better would be something like this:

this.displayClass = this.CLASS_NAME.replace("OpenLayers.", "ol").replace(/\./g, "");

Attachments

Control.displayClass.diff (0.6 kB) - added by fredj on 06/29/07 02:18:14.
remove all the periods
Control.displayClass.tests.diff (7.5 kB) - added by fredj on 06/29/07 02:22:30.
test if control.displayClass is correct (in tests/Control/test_*)

Change History

06/29/07 02:18:14 changed by fredj

  • attachment Control.displayClass.diff added.

remove all the periods

06/29/07 02:22:30 changed by fredj

  • attachment Control.displayClass.tests.diff added.

test if control.displayClass is correct (in tests/Control/test_*)

06/29/07 02:23:03 changed by fredj

  • type changed from feature to bug.
  • summary changed from Control displayClass to Control displayClass is not correct if CLASS_NAME contains > 2 periods.

06/29/07 02:23:59 changed by fredj

  • summary changed from Control displayClass is not correct if CLASS_NAME contains > 2 periods to Control displayClass is not correct if CLASS_NAME contains >= 2 periods.

06/29/07 05:56:12 changed by crschmidt

  • status changed from new to closed.
  • resolution set to fixed.

Applied in r3534.