mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 22:27:55 +01:00
Keep fixing issues.
This commit is contained in:
parent
f1fa99a85e
commit
695b8d92e3
@ -24,11 +24,11 @@ mindplot.ScreenManager = new Class({
|
|||||||
|
|
||||||
// Ignore default click event propagation. Prevent 'click' event on drag.
|
// Ignore default click event propagation. Prevent 'click' event on drag.
|
||||||
this._clickEvents = [];
|
this._clickEvents = [];
|
||||||
this._divContainer.addEvent('click', function(event) {
|
this._divContainer.bind('click', function(event) {
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
this._divContainer.addEvent('dblclick', function(event) {
|
this._divContainer.bind('dblclick', function(event) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
});
|
});
|
||||||
@ -43,7 +43,7 @@ mindplot.ScreenManager = new Class({
|
|||||||
if (event == 'click')
|
if (event == 'click')
|
||||||
this._clickEvents.push(listener);
|
this._clickEvents.push(listener);
|
||||||
else
|
else
|
||||||
this._divContainer.addEvent(event, listener);
|
this._divContainer.bind(event, listener);
|
||||||
},
|
},
|
||||||
|
|
||||||
removeEvent : function(event, listener) {
|
removeEvent : function(event, listener) {
|
||||||
@ -62,7 +62,7 @@ mindplot.ScreenManager = new Class({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this._divContainer.fireEvent(type, event);
|
this._divContainer.trigger(type, event);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -26,8 +26,8 @@ mindplot.Workspace = new Class({
|
|||||||
this._screenManager = screenManager;
|
this._screenManager = screenManager;
|
||||||
|
|
||||||
var divContainer = screenManager.getContainer();
|
var divContainer = screenManager.getContainer();
|
||||||
this._screenWidth = parseInt(divContainer.getStyle('width'));
|
this._screenWidth = parseInt(divContainer.css('width'));
|
||||||
this._screenHeight = parseInt(divContainer.getStyle('height'));
|
this._screenHeight = parseInt(divContainer.css('height'));
|
||||||
|
|
||||||
// Initialize web2d workspace.
|
// Initialize web2d workspace.
|
||||||
var workspace = this._createWorkspace();
|
var workspace = this._createWorkspace();
|
||||||
|
@ -26,12 +26,12 @@ mindplot.widget.Menu = new Class({
|
|||||||
var widgetsBaseUrl = baseUrl + "css/widget";
|
var widgetsBaseUrl = baseUrl + "css/widget";
|
||||||
|
|
||||||
// Stop event propagation ...
|
// Stop event propagation ...
|
||||||
document.id(this._containerId).addEvent('click', function (event) {
|
$('#'+this._containerId).addEvent('click', function (event) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
document.id(this._containerId).addEvent('dblclick', function (event) {
|
$("#" + this._containerId).bind('dblclick', function (event) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
@ -39,7 +39,7 @@ mindplot.widget.Menu = new Class({
|
|||||||
// Create panels ...
|
// Create panels ...
|
||||||
var designerModel = designer.getModel();
|
var designerModel = designer.getModel();
|
||||||
|
|
||||||
var fontFamilyBtn = document.id('fontFamily');
|
var fontFamilyBtn = $('#fontFamily');
|
||||||
if (fontFamilyBtn) {
|
if (fontFamilyBtn) {
|
||||||
var fontFamilyModel = {
|
var fontFamilyModel = {
|
||||||
getValue: function () {
|
getValue: function () {
|
||||||
@ -65,7 +65,7 @@ mindplot.widget.Menu = new Class({
|
|||||||
this._registerTooltip('fontFamily', $msg('FONT_FAMILY'));
|
this._registerTooltip('fontFamily', $msg('FONT_FAMILY'));
|
||||||
}
|
}
|
||||||
|
|
||||||
var fontSizeBtn = document.id('fontSize');
|
var fontSizeBtn = $('#fontSize');
|
||||||
if (fontSizeBtn) {
|
if (fontSizeBtn) {
|
||||||
var fontSizeModel = {
|
var fontSizeModel = {
|
||||||
getValue: function () {
|
getValue: function () {
|
||||||
@ -89,7 +89,7 @@ mindplot.widget.Menu = new Class({
|
|||||||
this._registerTooltip('fontSize', $msg('FONT_SIZE'));
|
this._registerTooltip('fontSize', $msg('FONT_SIZE'));
|
||||||
}
|
}
|
||||||
|
|
||||||
var topicShapeBtn = document.id('topicShape');
|
var topicShapeBtn = $('#topicShape');
|
||||||
if (topicShapeBtn) {
|
if (topicShapeBtn) {
|
||||||
var topicShapeModel = {
|
var topicShapeModel = {
|
||||||
getValue: function () {
|
getValue: function () {
|
||||||
@ -113,7 +113,7 @@ mindplot.widget.Menu = new Class({
|
|||||||
this._registerTooltip('topicShape', $msg('TOPIC_SHAPE'));
|
this._registerTooltip('topicShape', $msg('TOPIC_SHAPE'));
|
||||||
}
|
}
|
||||||
|
|
||||||
var topicIconBtn = document.id('topicIcon');
|
var topicIconBtn = $('#topicIcon');
|
||||||
if (topicIconBtn) {
|
if (topicIconBtn) {
|
||||||
// Create icon panel dialog ...
|
// Create icon panel dialog ...
|
||||||
var topicIconModel = {
|
var topicIconModel = {
|
||||||
@ -129,7 +129,7 @@ mindplot.widget.Menu = new Class({
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Topic color item ...
|
// Topic color item ...
|
||||||
var topicColorBtn = document.id('topicColor');
|
var topicColorBtn = $('#topicColor');
|
||||||
if (topicColorBtn) {
|
if (topicColorBtn) {
|
||||||
|
|
||||||
var topicColorModel = {
|
var topicColorModel = {
|
||||||
@ -155,7 +155,7 @@ mindplot.widget.Menu = new Class({
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Border color item ...
|
// Border color item ...
|
||||||
var topicBorderBtn = document.id('topicBorder');
|
var topicBorderBtn = $('#topicBorder');
|
||||||
if (topicBorderBtn) {
|
if (topicBorderBtn) {
|
||||||
var borderColorModel =
|
var borderColorModel =
|
||||||
{
|
{
|
||||||
@ -181,7 +181,7 @@ mindplot.widget.Menu = new Class({
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Font color item ...
|
// Font color item ...
|
||||||
var fontColorBtn = document.id('fontColor');
|
var fontColorBtn = $('#fontColor');
|
||||||
if (fontColorBtn) {
|
if (fontColorBtn) {
|
||||||
var fontColorModel =
|
var fontColorModel =
|
||||||
{
|
{
|
||||||
@ -316,7 +316,7 @@ mindplot.widget.Menu = new Class({
|
|||||||
this._registerTooltip('fontItalic', $msg('FONT_ITALIC'), "meta+I");
|
this._registerTooltip('fontItalic', $msg('FONT_ITALIC'), "meta+I");
|
||||||
|
|
||||||
|
|
||||||
var saveElem = document.id('save');
|
var saveElem = $('#save');
|
||||||
if (saveElem) {
|
if (saveElem) {
|
||||||
this._addButton('save', false, false, function () {
|
this._addButton('save', false, false, function () {
|
||||||
this.save(saveElem, designer, true);
|
this.save(saveElem, designer, true);
|
||||||
@ -327,7 +327,7 @@ mindplot.widget.Menu = new Class({
|
|||||||
if (!readOnly) {
|
if (!readOnly) {
|
||||||
// To prevent the user from leaving the page with changes ...
|
// To prevent the user from leaving the page with changes ...
|
||||||
Element.NativeEvents.unload = 1;
|
Element.NativeEvents.unload = 1;
|
||||||
document.id(window).addEvent('unload', function () {
|
$(window).bind('unload', function () {
|
||||||
if (this.isSaveRequired()) {
|
if (this.isSaveRequired()) {
|
||||||
this.save(saveElem, designer, false, true);
|
this.save(saveElem, designer, false, true);
|
||||||
}
|
}
|
||||||
@ -343,7 +343,7 @@ mindplot.widget.Menu = new Class({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var discardElem = document.id('discard');
|
var discardElem = $('#discard');
|
||||||
if (discardElem) {
|
if (discardElem) {
|
||||||
this._addButton('discard', false, false, function () {
|
this._addButton('discard', false, false, function () {
|
||||||
this.discardChanges(designer);
|
this.discardChanges(designer);
|
||||||
@ -351,7 +351,7 @@ mindplot.widget.Menu = new Class({
|
|||||||
this._registerTooltip('discard', $msg('DISCARD_CHANGES'));
|
this._registerTooltip('discard', $msg('DISCARD_CHANGES'));
|
||||||
}
|
}
|
||||||
|
|
||||||
var shareElem = document.id('shareIt');
|
var shareElem = $('#shareIt');
|
||||||
if (shareElem) {
|
if (shareElem) {
|
||||||
this._addButton('shareIt', false, false, function () {
|
this._addButton('shareIt', false, false, function () {
|
||||||
var reqDialog = new MooDialog.Request('c/iframeWrapper?url=c/maps/' + mapId + "/sharef", null,
|
var reqDialog = new MooDialog.Request('c/iframeWrapper?url=c/maps/' + mapId + "/sharef", null,
|
||||||
@ -371,7 +371,7 @@ mindplot.widget.Menu = new Class({
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var publishElem = document.id('publishIt');
|
var publishElem = $('#publishIt');
|
||||||
if (publishElem) {
|
if (publishElem) {
|
||||||
this._addButton('publishIt', false, false, function () {
|
this._addButton('publishIt', false, false, function () {
|
||||||
var reqDialog = new MooDialog.Request('c/iframeWrapper?url=c/maps/' + mapId + "/publishf", null,
|
var reqDialog = new MooDialog.Request('c/iframeWrapper?url=c/maps/' + mapId + "/publishf", null,
|
||||||
@ -391,7 +391,7 @@ mindplot.widget.Menu = new Class({
|
|||||||
this._registerTooltip('publishIt', $msg('PUBLISH'));
|
this._registerTooltip('publishIt', $msg('PUBLISH'));
|
||||||
}
|
}
|
||||||
|
|
||||||
var historyElem = document.id('history');
|
var historyElem = $('#history');
|
||||||
if (historyElem) {
|
if (historyElem) {
|
||||||
|
|
||||||
this._addButton('history', false, false, function () {
|
this._addButton('history', false, false, function () {
|
||||||
@ -413,7 +413,7 @@ mindplot.widget.Menu = new Class({
|
|||||||
this._registerEvents(designer);
|
this._registerEvents(designer);
|
||||||
|
|
||||||
// Keyboard Shortcuts Action ...
|
// Keyboard Shortcuts Action ...
|
||||||
var keyboardShortcut = document.id('keyboardShortcuts');
|
var keyboardShortcut = $('#keyboardShortcuts');
|
||||||
if (keyboardShortcut) {
|
if (keyboardShortcut) {
|
||||||
|
|
||||||
keyboardShortcut.addEvent('click', function (event) {
|
keyboardShortcut.addEvent('click', function (event) {
|
||||||
@ -501,7 +501,7 @@ mindplot.widget.Menu = new Class({
|
|||||||
_addButton: function (buttonId, topic, rel, fn) {
|
_addButton: function (buttonId, topic, rel, fn) {
|
||||||
// Register Events ...
|
// Register Events ...
|
||||||
var result = null;
|
var result = null;
|
||||||
if (document.id(buttonId)) {
|
if ($('#'+buttonId)) {
|
||||||
|
|
||||||
var button = new mindplot.widget.ToolbarItem(buttonId, function (event) {
|
var button = new mindplot.widget.ToolbarItem(buttonId, function (event) {
|
||||||
fn(event);
|
fn(event);
|
||||||
@ -515,13 +515,13 @@ mindplot.widget.Menu = new Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_registerTooltip: function (buttonId, text, shortcut) {
|
_registerTooltip: function (buttonId, text, shortcut) {
|
||||||
if (document.id(buttonId)) {
|
if ($('#'+buttonId)) {
|
||||||
var tooltip = text;
|
var tooltip = text;
|
||||||
if (shortcut) {
|
if (shortcut) {
|
||||||
shortcut = Browser.Platform.mac ? shortcut.replace("meta+", "⌘") : shortcut.replace("meta+", "ctrl+");
|
shortcut = Browser.Platform.mac ? shortcut.replace("meta+", "⌘") : shortcut.replace("meta+", "ctrl+");
|
||||||
tooltip = tooltip + " (" + shortcut + ")";
|
tooltip = tooltip + " (" + shortcut + ")";
|
||||||
}
|
}
|
||||||
new mindplot.widget.KeyboardShortcutTooltip(document.id(buttonId), tooltip);
|
new mindplot.widget.KeyboardShortcutTooltip($('#'+buttonId), tooltip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
Loading…
Reference in New Issue
Block a user