Solve partially Firefox 11 issue.
This commit is contained in:
44
web2d/src/main/javascript/Point.js
Normal file
44
web2d/src/main/javascript/Point.js
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
* It is basically the Apache License, Version 2.0 (the "License") plus the
|
||||
* "powered by wisemapping" text requirement on every single page;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the license at
|
||||
*
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
core.Point = new Class({
|
||||
initialize : function(x, y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
},
|
||||
|
||||
setValue : function(x, y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
},
|
||||
|
||||
inspect : function() {
|
||||
return "{x:" + this.x + ",y:" + this.y + "}";
|
||||
},
|
||||
|
||||
clone : function() {
|
||||
return new core.Point(this.x, this.y);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
core.Point.fromString = function(point) {
|
||||
var values = point.split(',');
|
||||
return new core.Point(values[0], values[1]);
|
||||
|
||||
};
|
@@ -19,6 +19,13 @@
|
||||
web2d.peer.svg.ElementPeer = new Class({
|
||||
initialize :function(svgElement) {
|
||||
this._native = svgElement;
|
||||
if (!this._native.addEvent) {
|
||||
// Hack bug: https://bugzilla.mozilla.org/show_bug.cgi?id=740811
|
||||
for (var key in Element) {
|
||||
this._native[key] = Element.prototype[key];
|
||||
}
|
||||
}
|
||||
|
||||
this._size = {width:1,height:1};
|
||||
this._changeListeners = {};
|
||||
// http://support.adobe.com/devsup/devsup.nsf/docs/50493.htm
|
||||
@@ -82,7 +89,8 @@ web2d.peer.svg.ElementPeer = new Class({
|
||||
* http://developer.mozilla.org/en/docs/addEvent
|
||||
*/
|
||||
addEvent : function(type, listener) {
|
||||
this._native.addEvent(type, listener);
|
||||
// this._native.addEvent(type, listener);
|
||||
this._native.addEventListener(type, listener);
|
||||
},
|
||||
|
||||
fireEvent : function(type) {
|
||||
|
Reference in New Issue
Block a user