mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-12-23 03:43:48 +01:00
Wheel enabled on read only maps
Fix NPE on mobile firefox on UserAgent MindmapList display list fix on read only maps.
This commit is contained in:
parent
029bfa809a
commit
662fc82919
@ -55,9 +55,15 @@ mindplot.Designer = new Class({
|
||||
|
||||
// Register events
|
||||
if (!this.isReadOnly()) {
|
||||
this._registerEvents();
|
||||
// Register mouse events ...
|
||||
this._registerMouseEvents();
|
||||
|
||||
// Register keyboard events ...
|
||||
mindplot.DesignerKeyboard.register(this);
|
||||
|
||||
this._dragManager = this._buildDragManager(this._workspace);
|
||||
}
|
||||
this._registerWheelEvents();
|
||||
|
||||
this._relPivot = new mindplot.RelationshipPivot(this._workspace, this);
|
||||
|
||||
@ -76,6 +82,29 @@ mindplot.Designer = new Class({
|
||||
this.deselectAll();
|
||||
},
|
||||
|
||||
_registerWheelEvents:function () {
|
||||
// Zoom In and Zoom Out must active event
|
||||
$(document).addEvent('mousewheel', function (event) {
|
||||
// Change mousewheel handling so we let the default
|
||||
//event happen if we are outside the container.
|
||||
var coords = screenManager.getContainer().getCoordinates();
|
||||
var isOutsideContainer = event.client.y < coords.top ||
|
||||
event.client.y > coords.bottom ||
|
||||
event.client.x < coords.left ||
|
||||
event.client.x > coords.right;
|
||||
|
||||
if (!isOutsideContainer) {
|
||||
if (event.wheel > 0) {
|
||||
this.zoomIn(1.05);
|
||||
}
|
||||
else {
|
||||
this.zoomOut(1.05);
|
||||
}
|
||||
event.preventDefault();
|
||||
}
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
/**
|
||||
* Activates the keyboard events so you can enter text into forms
|
||||
*/
|
||||
@ -84,13 +113,6 @@ mindplot.Designer = new Class({
|
||||
},
|
||||
|
||||
|
||||
_registerEvents:function () {
|
||||
// Register mouse events ...
|
||||
this._registerMouseEvents();
|
||||
|
||||
// Register keyboard events ...
|
||||
mindplot.DesignerKeyboard.register(this);
|
||||
},
|
||||
|
||||
addEvent:function (type, listener) {
|
||||
if (type == mindplot.TopicEvent.EDIT || type == mindplot.TopicEvent.CLICK) {
|
||||
@ -136,27 +158,6 @@ mindplot.Designer = new Class({
|
||||
}
|
||||
}.bind(this));
|
||||
|
||||
|
||||
$(document).addEvent('mousewheel', function (event) {
|
||||
// Change mousewheel handling so we let the default
|
||||
//event happen if we are outside the container.
|
||||
var coords = screenManager.getContainer().getCoordinates();
|
||||
var isOutsideContainer = event.client.y < coords.top ||
|
||||
event.client.y > coords.bottom ||
|
||||
event.client.x < coords.left ||
|
||||
event.client.x > coords.right;
|
||||
|
||||
if (!isOutsideContainer) {
|
||||
if (event.wheel > 0) {
|
||||
this.zoomIn(1.05);
|
||||
}
|
||||
else {
|
||||
this.zoomOut(1.05);
|
||||
}
|
||||
event.preventDefault();
|
||||
}
|
||||
}.bind(this));
|
||||
|
||||
},
|
||||
|
||||
_buildDragManager:function (workspace) {
|
||||
|
@ -72,7 +72,6 @@ public class SupportedUserAgent implements Serializable {
|
||||
final UserAgent userAgent = this.getUserAgent();
|
||||
final Browser browser = userAgent.getBrowser();
|
||||
final Version version = userAgent.getBrowserVersion();
|
||||
final OperatingSystem os = userAgent.getOperatingSystem();
|
||||
|
||||
return (browser == Browser.IE8 || browser == Browser.IE && Integer.parseInt(version.getMajorVersion()) == 8) && !header.contains("chromeframe");
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
$.fn.dataTableExt.oApi.fnReloadAjax = function (oSettings, sNewSource, fnCallback, bStandingRedraw) {
|
||||
if (typeof sNewSource != 'undefined' && sNewSource != null) {
|
||||
oSettings.sAjaxSource = sNewSource;
|
||||
@ -180,7 +179,9 @@ function updateStatusToolbar() {
|
||||
|
||||
// Can be executed by the owner ?
|
||||
var rowData = tableElem.dataTable().fnGetData(selectedRows[0]);
|
||||
if (rowData.role != 'owner') {
|
||||
if ('owner' == rowData.role) {
|
||||
$(".buttonsToolbar").find('#publishBtn').show().end().find('#shareBtn').show().end().find('#renameBtn').show();
|
||||
} else {
|
||||
$(".buttonsToolbar").find('#publishBtn').hide().end().find('#shareBtn').hide().end().find('#renameBtn').hide();
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user