mirror of https://github.com/apache/nifi.git
Merge branch 'develop' of https://git-wip-us.apache.org/repos/asf/incubator-nifi into develop
This commit is contained in:
commit
c62aba1336
|
@ -272,6 +272,10 @@ nf.Birdseye = (function () {
|
||||||
y: d.y
|
y: d.y
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
.on('dragstart', function () {
|
||||||
|
// hide the context menu
|
||||||
|
nf.ContextMenu.hide();
|
||||||
|
})
|
||||||
.on('drag', function (d) {
|
.on('drag', function (d) {
|
||||||
d.x += d3.event.dx;
|
d.x += d3.event.dx;
|
||||||
d.y += d3.event.dy;
|
d.y += d3.event.dy;
|
||||||
|
|
|
@ -71,6 +71,10 @@ nf.CanvasToolbox = (function () {
|
||||||
return $('<div class="toolbox-icon"></div>').addClass(dragCls).appendTo('body');
|
return $('<div class="toolbox-icon"></div>').addClass(dragCls).appendTo('body');
|
||||||
},
|
},
|
||||||
'containment': 'body',
|
'containment': 'body',
|
||||||
|
'start': function(e, ui) {
|
||||||
|
// hide the context menu if necessary
|
||||||
|
nf.ContextMenu.hide();
|
||||||
|
},
|
||||||
'stop': function (e, ui) {
|
'stop': function (e, ui) {
|
||||||
var translate = nf.Canvas.View.translate();
|
var translate = nf.Canvas.View.translate();
|
||||||
var scale = nf.Canvas.View.scale();
|
var scale = nf.Canvas.View.scale();
|
||||||
|
|
|
@ -427,9 +427,6 @@ nf.Canvas = (function () {
|
||||||
// reset the canvas click flag
|
// reset the canvas click flag
|
||||||
canvasClicked = false;
|
canvasClicked = false;
|
||||||
|
|
||||||
// hide the context menu if necessary
|
|
||||||
nf.ContextMenu.hide();
|
|
||||||
|
|
||||||
// get the selection box
|
// get the selection box
|
||||||
var selectionBox = d3.select('rect.selection');
|
var selectionBox = d3.select('rect.selection');
|
||||||
if (!selectionBox.empty()) {
|
if (!selectionBox.empty()) {
|
||||||
|
@ -866,6 +863,9 @@ nf.Canvas = (function () {
|
||||||
*/
|
*/
|
||||||
reload: function () {
|
reload: function () {
|
||||||
return $.Deferred(function (deferred) {
|
return $.Deferred(function (deferred) {
|
||||||
|
// hide the context menu
|
||||||
|
nf.ContextMenu.hide();
|
||||||
|
|
||||||
// get the process group to refresh everything
|
// get the process group to refresh everything
|
||||||
var processGroupXhr = reloadProcessGroup(nf.Canvas.getGroupId());
|
var processGroupXhr = reloadProcessGroup(nf.Canvas.getGroupId());
|
||||||
var statusXhr = reloadFlowStatus();
|
var statusXhr = reloadFlowStatus();
|
||||||
|
@ -983,6 +983,7 @@ nf.Canvas = (function () {
|
||||||
// initialize the application
|
// initialize the application
|
||||||
initCanvas();
|
initCanvas();
|
||||||
nf.Canvas.View.init();
|
nf.Canvas.View.init();
|
||||||
|
nf.ContextMenu.init();
|
||||||
nf.CanvasHeader.init();
|
nf.CanvasHeader.init();
|
||||||
nf.CanvasToolbox.init();
|
nf.CanvasToolbox.init();
|
||||||
nf.CanvasToolbar.init();
|
nf.CanvasToolbar.init();
|
||||||
|
@ -1077,6 +1078,7 @@ nf.Canvas = (function () {
|
||||||
setGroupId: function (gi) {
|
setGroupId: function (gi) {
|
||||||
groupId = gi;
|
groupId = gi;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the group id.
|
* Get the group id.
|
||||||
*/
|
*/
|
||||||
|
@ -1222,6 +1224,10 @@ nf.Canvas = (function () {
|
||||||
.scaleExtent([MIN_SCALE, MAX_SCALE])
|
.scaleExtent([MIN_SCALE, MAX_SCALE])
|
||||||
.translate(TRANSLATE)
|
.translate(TRANSLATE)
|
||||||
.scale(SCALE)
|
.scale(SCALE)
|
||||||
|
.on('zoomstart', function () {
|
||||||
|
// hide the context menu
|
||||||
|
nf.ContextMenu.hide();
|
||||||
|
})
|
||||||
.on('zoom', function () {
|
.on('zoom', function () {
|
||||||
// if we have zoomed, indicate that we are panning
|
// if we have zoomed, indicate that we are panning
|
||||||
// to prevent deselection elsewhere
|
// to prevent deselection elsewhere
|
||||||
|
|
|
@ -382,6 +382,14 @@ nf.ContextMenu = (function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
init: function () {
|
||||||
|
$('#context-menu').on('contextmenu', function(evt) {
|
||||||
|
// stop propagation and prevent default
|
||||||
|
evt.preventDefault();
|
||||||
|
evt.stopPropagation();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shows the context menu.
|
* Shows the context menu.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -26,10 +26,13 @@ nf.GraphControl = (function () {
|
||||||
*/
|
*/
|
||||||
init: function () {
|
init: function () {
|
||||||
// pan up
|
// pan up
|
||||||
nf.Common.addHoverEffect('#pan-up-button', 'pan-up', 'pan-up-hover').click(function () {
|
nf.Common.addHoverEffect('#pan-up-button', 'pan-up', 'pan-up-hover').on('click', function () {
|
||||||
var translate = nf.Canvas.View.translate();
|
var translate = nf.Canvas.View.translate();
|
||||||
nf.Canvas.View.translate([translate[0], translate[1] + config.translateIncrement]);
|
nf.Canvas.View.translate([translate[0], translate[1] + config.translateIncrement]);
|
||||||
|
|
||||||
|
// hide the context menu
|
||||||
|
nf.ContextMenu.hide();
|
||||||
|
|
||||||
// refresh the canvas
|
// refresh the canvas
|
||||||
nf.Canvas.View.refresh({
|
nf.Canvas.View.refresh({
|
||||||
transition: true
|
transition: true
|
||||||
|
@ -37,10 +40,13 @@ nf.GraphControl = (function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
// pan down
|
// pan down
|
||||||
nf.Common.addHoverEffect('#pan-down-button', 'pan-down', 'pan-down-hover').click(function () {
|
nf.Common.addHoverEffect('#pan-down-button', 'pan-down', 'pan-down-hover').on('click', function () {
|
||||||
var translate = nf.Canvas.View.translate();
|
var translate = nf.Canvas.View.translate();
|
||||||
nf.Canvas.View.translate([translate[0], translate[1] - config.translateIncrement]);
|
nf.Canvas.View.translate([translate[0], translate[1] - config.translateIncrement]);
|
||||||
|
|
||||||
|
// hide the context menu
|
||||||
|
nf.ContextMenu.hide();
|
||||||
|
|
||||||
// refresh the canvas
|
// refresh the canvas
|
||||||
nf.Canvas.View.refresh({
|
nf.Canvas.View.refresh({
|
||||||
transition: true
|
transition: true
|
||||||
|
@ -48,10 +54,13 @@ nf.GraphControl = (function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
// pan left
|
// pan left
|
||||||
nf.Common.addHoverEffect('#pan-left-button', 'pan-left', 'pan-left-hover').click(function () {
|
nf.Common.addHoverEffect('#pan-left-button', 'pan-left', 'pan-left-hover').on('click', function () {
|
||||||
var translate = nf.Canvas.View.translate();
|
var translate = nf.Canvas.View.translate();
|
||||||
nf.Canvas.View.translate([translate[0] + config.translateIncrement, translate[1]]);
|
nf.Canvas.View.translate([translate[0] + config.translateIncrement, translate[1]]);
|
||||||
|
|
||||||
|
// hide the context menu
|
||||||
|
nf.ContextMenu.hide();
|
||||||
|
|
||||||
// refresh the canvas
|
// refresh the canvas
|
||||||
nf.Canvas.View.refresh({
|
nf.Canvas.View.refresh({
|
||||||
transition: true
|
transition: true
|
||||||
|
@ -59,10 +68,13 @@ nf.GraphControl = (function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
// pan right
|
// pan right
|
||||||
nf.Common.addHoverEffect('#pan-right-button', 'pan-right', 'pan-right-hover').click(function () {
|
nf.Common.addHoverEffect('#pan-right-button', 'pan-right', 'pan-right-hover').on('click', function () {
|
||||||
var translate = nf.Canvas.View.translate();
|
var translate = nf.Canvas.View.translate();
|
||||||
nf.Canvas.View.translate([translate[0] - config.translateIncrement, translate[1]]);
|
nf.Canvas.View.translate([translate[0] - config.translateIncrement, translate[1]]);
|
||||||
|
|
||||||
|
// hide the context menu
|
||||||
|
nf.ContextMenu.hide();
|
||||||
|
|
||||||
// refresh the canvas
|
// refresh the canvas
|
||||||
nf.Canvas.View.refresh({
|
nf.Canvas.View.refresh({
|
||||||
transition: true
|
transition: true
|
||||||
|
@ -70,9 +82,12 @@ nf.GraphControl = (function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
// zoom in
|
// zoom in
|
||||||
nf.Common.addHoverEffect('#zoom-in-button', 'zoom-in', 'zoom-in-hover').click(function () {
|
nf.Common.addHoverEffect('#zoom-in-button', 'zoom-in', 'zoom-in-hover').on('click', function () {
|
||||||
nf.Canvas.View.zoomIn();
|
nf.Canvas.View.zoomIn();
|
||||||
|
|
||||||
|
// hide the context menu
|
||||||
|
nf.ContextMenu.hide();
|
||||||
|
|
||||||
// refresh the canvas
|
// refresh the canvas
|
||||||
nf.Canvas.View.refresh({
|
nf.Canvas.View.refresh({
|
||||||
transition: true
|
transition: true
|
||||||
|
@ -80,9 +95,12 @@ nf.GraphControl = (function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
// zoom out
|
// zoom out
|
||||||
nf.Common.addHoverEffect('#zoom-out-button', 'zoom-out', 'zoom-out-hover').click(function () {
|
nf.Common.addHoverEffect('#zoom-out-button', 'zoom-out', 'zoom-out-hover').on('click', function () {
|
||||||
nf.Canvas.View.zoomOut();
|
nf.Canvas.View.zoomOut();
|
||||||
|
|
||||||
|
// hide the context menu
|
||||||
|
nf.ContextMenu.hide();
|
||||||
|
|
||||||
// refresh the canvas
|
// refresh the canvas
|
||||||
nf.Canvas.View.refresh({
|
nf.Canvas.View.refresh({
|
||||||
transition: true
|
transition: true
|
||||||
|
@ -90,9 +108,12 @@ nf.GraphControl = (function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
// zoom fit
|
// zoom fit
|
||||||
nf.Common.addHoverEffect('#zoom-fit-button', 'fit-image', 'fit-image-hover').click(function () {
|
nf.Common.addHoverEffect('#zoom-fit-button', 'fit-image', 'fit-image-hover').on('click', function () {
|
||||||
nf.Canvas.View.fit();
|
nf.Canvas.View.fit();
|
||||||
|
|
||||||
|
// hide the context menu
|
||||||
|
nf.ContextMenu.hide();
|
||||||
|
|
||||||
// refresh the canvas
|
// refresh the canvas
|
||||||
nf.Canvas.View.refresh({
|
nf.Canvas.View.refresh({
|
||||||
transition: true
|
transition: true
|
||||||
|
@ -100,9 +121,12 @@ nf.GraphControl = (function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
// one to one
|
// one to one
|
||||||
nf.Common.addHoverEffect('#zoom-actual-button', 'actual-size', 'actual-size-hover').click(function () {
|
nf.Common.addHoverEffect('#zoom-actual-button', 'actual-size', 'actual-size-hover').on('click', function () {
|
||||||
nf.Canvas.View.actualSize();
|
nf.Canvas.View.actualSize();
|
||||||
|
|
||||||
|
// hide the context menu
|
||||||
|
nf.ContextMenu.hide();
|
||||||
|
|
||||||
// refresh the canvas
|
// refresh the canvas
|
||||||
nf.Canvas.View.refresh({
|
nf.Canvas.View.refresh({
|
||||||
transition: true
|
transition: true
|
||||||
|
|
|
@ -166,6 +166,9 @@ nf.Search = (function () {
|
||||||
$('div.search-glass-pane').remove();
|
$('div.search-glass-pane').remove();
|
||||||
}
|
}
|
||||||
}).focus(function () {
|
}).focus(function () {
|
||||||
|
// hide the context menu if necessary
|
||||||
|
nf.ContextMenu.hide();
|
||||||
|
|
||||||
// clear the text for the user to type
|
// clear the text for the user to type
|
||||||
$(this).val('').removeClass('search-flow');
|
$(this).val('').removeClass('search-flow');
|
||||||
}).blur(function () {
|
}).blur(function () {
|
||||||
|
|
|
@ -62,6 +62,10 @@ nf.ToolbarAction.prototype.initAction = function () {
|
||||||
}
|
}
|
||||||
}).click(function () {
|
}).click(function () {
|
||||||
if (!$(this).hasClass(self.disableCls)) {
|
if (!$(this).hasClass(self.disableCls)) {
|
||||||
|
// hide the context menu
|
||||||
|
nf.ContextMenu.hide();
|
||||||
|
|
||||||
|
// execute the action
|
||||||
nf.Actions[self.action](nf.CanvasUtils.getSelection());
|
nf.Actions[self.action](nf.CanvasUtils.getSelection());
|
||||||
}
|
}
|
||||||
}).appendTo(this.container);
|
}).appendTo(this.container);
|
||||||
|
|
Loading…
Reference in New Issue