mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-25 23:54:55 +01:00
Remove global refernece to $msg
This commit is contained in:
parent
5b74b9cff3
commit
f95e65f21b
@ -17,9 +17,9 @@
|
||||
*/
|
||||
import { $assert, $defined } from '@wisemapping/core-js';
|
||||
import $ from 'jquery';
|
||||
import Messages, { $msg } from './Messages';
|
||||
|
||||
import Events from './Events';
|
||||
import Messages from './Messages';
|
||||
import StandaloneActionDispatcher from './StandaloneActionDispatcher';
|
||||
|
||||
import CommandContext from './CommandContext';
|
||||
@ -258,19 +258,15 @@ class Designer extends Events {
|
||||
if (isConnected) {
|
||||
// Improve this ...
|
||||
const targetTopicModel = model.getParent();
|
||||
let targetTopic = null;
|
||||
|
||||
// Find target topic with the same model ...
|
||||
const topics = this.getModel().getTopics();
|
||||
for (let i = 0; i < topics.length; i++) {
|
||||
const t = topics[i];
|
||||
if (t.getModel() === targetTopicModel) {
|
||||
targetTopic = t;
|
||||
// Disconnect the node. It will be connected again later ...
|
||||
model.disconnect();
|
||||
break;
|
||||
}
|
||||
const targetTopic = topics.find((t) => t.getModel() === targetTopicModel);
|
||||
if (targetTopic) {
|
||||
model.disconnect();
|
||||
} else {
|
||||
$assert(targetTopic, 'Could not find a topic to connect');
|
||||
}
|
||||
$assert(targetTopic, 'Could not find a topic to connect');
|
||||
topic.connectTo(targetTopic, this._workspace);
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ class Messages {
|
||||
}
|
||||
|
||||
// @Todo: fix global assignment.
|
||||
global.$msg = function $msg(key) {
|
||||
const $msg = function $msg(key) {
|
||||
if (!Messages.__bundle) {
|
||||
Messages.init('en');
|
||||
}
|
||||
@ -43,3 +43,4 @@ global.$msg = function $msg(key) {
|
||||
|
||||
Messages.BUNDLES = {};
|
||||
export default Messages;
|
||||
export { $msg };
|
||||
|
@ -17,6 +17,7 @@
|
||||
*/
|
||||
import { $assert } from '@wisemapping/core-js';
|
||||
import $ from 'jquery';
|
||||
import { $msg } from './Messages';
|
||||
import Icon from './Icon';
|
||||
import FloatingTip from './widget/FloatingTip';
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { $assert } from '@wisemapping/core-js';
|
||||
import { $msg } from './Messages';
|
||||
import PersistenceManager from './PersistenceManager';
|
||||
|
||||
class RESTPersistenceManager extends PersistenceManager{
|
||||
|
@ -16,6 +16,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { $assert, $defined } from '@wisemapping/core-js';
|
||||
import { $msg } from './Messages';
|
||||
import { TopicShape } from './model/INodeModel';
|
||||
|
||||
class TopicStyle {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import Options from '../../Options';
|
||||
|
||||
import { $msg } from '../../Messages';
|
||||
import $ from 'jquery';
|
||||
|
||||
class BootstrapDialog extends Options {
|
||||
@ -36,7 +36,7 @@ class BootstrapDialog extends Options {
|
||||
content.append(footer);
|
||||
}
|
||||
this._native.find('.modal-dialog').append(content);
|
||||
this._native.on('hidden.bs.modal', function () {
|
||||
this._native.on('hidden.bs.modal', function remove() {
|
||||
$(this).remove();
|
||||
});
|
||||
this._native.on('shown.bs.modal', this.onDialogShown);
|
||||
|
@ -16,6 +16,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { $assert } from '@wisemapping/core-js';
|
||||
import { $msg } from '../Messages';
|
||||
import PersistenceManager from '../PersistenceManager';
|
||||
import { $notify } from './ToolbarNotifier';
|
||||
import $notifyModal from './ModalDialogNotifier';
|
||||
|
@ -17,6 +17,7 @@
|
||||
*/
|
||||
import $ from 'jquery';
|
||||
import { $assert } from '@wisemapping/core-js';
|
||||
import { $msg } from '../Messages';
|
||||
import BootstrapDialog from '../libraries/bootstrap/BootstrapDialog';
|
||||
|
||||
class LinkEditor extends BootstrapDialog {
|
||||
|
@ -17,6 +17,7 @@
|
||||
*/
|
||||
import { $assert } from "@wisemapping/core-js";
|
||||
import $ from 'jquery';
|
||||
import { $msg } from '../Messages';
|
||||
import FloatingTip from './FloatingTip';
|
||||
|
||||
class LinkIconTooltip extends FloatingTip {
|
||||
|
@ -16,8 +16,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import $ from 'jquery';
|
||||
|
||||
import { $defined } from '@wisemapping/core-js';
|
||||
import { $msg } from '../Messages';
|
||||
import BootstrapDialogRequest from "../libraries/bootstrap/BootstrapDialogRequest";
|
||||
import IMenu from './IMenu';
|
||||
import FontFamilyPanel from './FontFamilyPanel';
|
||||
|
@ -18,6 +18,7 @@
|
||||
import { $assert } from '@wisemapping/core-js';
|
||||
import BootstrapDialog from '../libraries/bootstrap/BootstrapDialog';
|
||||
import $ from 'jquery';
|
||||
import { $msg } from '../Messages';
|
||||
|
||||
class NoteEditor extends BootstrapDialog {
|
||||
constructor(model) {
|
||||
|
@ -18,6 +18,8 @@
|
||||
import { $assert } from '@wisemapping/core-js';
|
||||
import { PersistenceManager, Designer, LocalStorageManager, Menu } from '../../../../src/';
|
||||
import * as mindplot from '../../../../src/';
|
||||
import { $msg } from '../../../../src/components/Messages';
|
||||
|
||||
import $notifyModal from '../../../../src/components/widget/ModalDialogNotifier';
|
||||
|
||||
import $ from 'jquery';
|
||||
|
Loading…
Reference in New Issue
Block a user