mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-05 07:03:24 +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.
|
||||
this._clickEvents = [];
|
||||
this._divContainer.addEvent('click', function(event) {
|
||||
this._divContainer.bind('click', function(event) {
|
||||
event.stopPropagation()
|
||||
}.bind(this));
|
||||
|
||||
this._divContainer.addEvent('dblclick', function(event) {
|
||||
this._divContainer.bind('dblclick', function(event) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
});
|
||||
@ -43,7 +43,7 @@ mindplot.ScreenManager = new Class({
|
||||
if (event == 'click')
|
||||
this._clickEvents.push(listener);
|
||||
else
|
||||
this._divContainer.addEvent(event, listener);
|
||||
this._divContainer.bind(event, listener);
|
||||
},
|
||||
|
||||
removeEvent : function(event, listener) {
|
||||
@ -62,7 +62,7 @@ mindplot.ScreenManager = new Class({
|
||||
});
|
||||
}
|
||||
else {
|
||||
this._divContainer.fireEvent(type, event);
|
||||
this._divContainer.trigger(type, event);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -26,8 +26,8 @@ mindplot.Workspace = new Class({
|
||||
this._screenManager = screenManager;
|
||||
|
||||
var divContainer = screenManager.getContainer();
|
||||
this._screenWidth = parseInt(divContainer.getStyle('width'));
|
||||
this._screenHeight = parseInt(divContainer.getStyle('height'));
|
||||
this._screenWidth = parseInt(divContainer.css('width'));
|
||||
this._screenHeight = parseInt(divContainer.css('height'));
|
||||
|
||||
// Initialize web2d workspace.
|
||||
var workspace = this._createWorkspace();
|
||||
|
@ -26,12 +26,12 @@ mindplot.widget.Menu = new Class({
|
||||
var widgetsBaseUrl = baseUrl + "css/widget";
|
||||
|
||||
// Stop event propagation ...
|
||||
document.id(this._containerId).addEvent('click', function (event) {
|
||||
$('#'+this._containerId).addEvent('click', function (event) {
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
});
|
||||
|
||||
document.id(this._containerId).addEvent('dblclick', function (event) {
|
||||
$("#" + this._containerId).bind('dblclick', function (event) {
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
});
|
||||
@ -39,7 +39,7 @@ mindplot.widget.Menu = new Class({
|
||||
// Create panels ...
|
||||
var designerModel = designer.getModel();
|
||||
|
||||
var fontFamilyBtn = document.id('fontFamily');
|
||||
var fontFamilyBtn = $('#fontFamily');
|
||||
if (fontFamilyBtn) {
|
||||
var fontFamilyModel = {
|
||||
getValue: function () {
|
||||
@ -65,7 +65,7 @@ mindplot.widget.Menu = new Class({
|
||||
this._registerTooltip('fontFamily', $msg('FONT_FAMILY'));
|
||||
}
|
||||
|
||||
var fontSizeBtn = document.id('fontSize');
|
||||
var fontSizeBtn = $('#fontSize');
|
||||
if (fontSizeBtn) {
|
||||
var fontSizeModel = {
|
||||
getValue: function () {
|
||||
@ -89,7 +89,7 @@ mindplot.widget.Menu = new Class({
|
||||
this._registerTooltip('fontSize', $msg('FONT_SIZE'));
|
||||
}
|
||||
|
||||
var topicShapeBtn = document.id('topicShape');
|
||||
var topicShapeBtn = $('#topicShape');
|
||||
if (topicShapeBtn) {
|
||||
var topicShapeModel = {
|
||||
getValue: function () {
|
||||
@ -113,7 +113,7 @@ mindplot.widget.Menu = new Class({
|
||||
this._registerTooltip('topicShape', $msg('TOPIC_SHAPE'));
|
||||
}
|
||||
|
||||
var topicIconBtn = document.id('topicIcon');
|
||||
var topicIconBtn = $('#topicIcon');
|
||||
if (topicIconBtn) {
|
||||
// Create icon panel dialog ...
|
||||
var topicIconModel = {
|
||||
@ -129,7 +129,7 @@ mindplot.widget.Menu = new Class({
|
||||
}
|
||||
|
||||
// Topic color item ...
|
||||
var topicColorBtn = document.id('topicColor');
|
||||
var topicColorBtn = $('#topicColor');
|
||||
if (topicColorBtn) {
|
||||
|
||||
var topicColorModel = {
|
||||
@ -155,7 +155,7 @@ mindplot.widget.Menu = new Class({
|
||||
}
|
||||
|
||||
// Border color item ...
|
||||
var topicBorderBtn = document.id('topicBorder');
|
||||
var topicBorderBtn = $('#topicBorder');
|
||||
if (topicBorderBtn) {
|
||||
var borderColorModel =
|
||||
{
|
||||
@ -181,7 +181,7 @@ mindplot.widget.Menu = new Class({
|
||||
}
|
||||
|
||||
// Font color item ...
|
||||
var fontColorBtn = document.id('fontColor');
|
||||
var fontColorBtn = $('#fontColor');
|
||||
if (fontColorBtn) {
|
||||
var fontColorModel =
|
||||
{
|
||||
@ -316,7 +316,7 @@ mindplot.widget.Menu = new Class({
|
||||
this._registerTooltip('fontItalic', $msg('FONT_ITALIC'), "meta+I");
|
||||
|
||||
|
||||
var saveElem = document.id('save');
|
||||
var saveElem = $('#save');
|
||||
if (saveElem) {
|
||||
this._addButton('save', false, false, function () {
|
||||
this.save(saveElem, designer, true);
|
||||
@ -327,7 +327,7 @@ mindplot.widget.Menu = new Class({
|
||||
if (!readOnly) {
|
||||
// To prevent the user from leaving the page with changes ...
|
||||
Element.NativeEvents.unload = 1;
|
||||
document.id(window).addEvent('unload', function () {
|
||||
$(window).bind('unload', function () {
|
||||
if (this.isSaveRequired()) {
|
||||
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) {
|
||||
this._addButton('discard', false, false, function () {
|
||||
this.discardChanges(designer);
|
||||
@ -351,7 +351,7 @@ mindplot.widget.Menu = new Class({
|
||||
this._registerTooltip('discard', $msg('DISCARD_CHANGES'));
|
||||
}
|
||||
|
||||
var shareElem = document.id('shareIt');
|
||||
var shareElem = $('#shareIt');
|
||||
if (shareElem) {
|
||||
this._addButton('shareIt', false, false, function () {
|
||||
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) {
|
||||
this._addButton('publishIt', false, false, function () {
|
||||
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'));
|
||||
}
|
||||
|
||||
var historyElem = document.id('history');
|
||||
var historyElem = $('#history');
|
||||
if (historyElem) {
|
||||
|
||||
this._addButton('history', false, false, function () {
|
||||
@ -413,7 +413,7 @@ mindplot.widget.Menu = new Class({
|
||||
this._registerEvents(designer);
|
||||
|
||||
// Keyboard Shortcuts Action ...
|
||||
var keyboardShortcut = document.id('keyboardShortcuts');
|
||||
var keyboardShortcut = $('#keyboardShortcuts');
|
||||
if (keyboardShortcut) {
|
||||
|
||||
keyboardShortcut.addEvent('click', function (event) {
|
||||
@ -501,7 +501,7 @@ mindplot.widget.Menu = new Class({
|
||||
_addButton: function (buttonId, topic, rel, fn) {
|
||||
// Register Events ...
|
||||
var result = null;
|
||||
if (document.id(buttonId)) {
|
||||
if ($('#'+buttonId)) {
|
||||
|
||||
var button = new mindplot.widget.ToolbarItem(buttonId, function (event) {
|
||||
fn(event);
|
||||
@ -515,13 +515,13 @@ mindplot.widget.Menu = new Class({
|
||||
},
|
||||
|
||||
_registerTooltip: function (buttonId, text, shortcut) {
|
||||
if (document.id(buttonId)) {
|
||||
if ($('#'+buttonId)) {
|
||||
var tooltip = text;
|
||||
if (shortcut) {
|
||||
shortcut = Browser.Platform.mac ? shortcut.replace("meta+", "⌘") : shortcut.replace("meta+", "ctrl+");
|
||||
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