Skip to content
Snippets Groups Projects
Commit 494b94d0 authored by juanf's avatar juanf
Browse files

SSDM-3501 : Dropdown menu fixes.

SVN: 37991
parent 91fd523a
No related branches found
No related tags found
No related merge requests found
......@@ -427,36 +427,38 @@ var SampleDataGridUtil = new function() {
$dropDownMenu.append($caret);
$dropDownMenu.append($list);
var clickFunction = function($dropDown) {
return function(event) {
var stopEventsBuble = function(event) {
event.stopPropagation();
event.preventDefault();
$caret.dropdown('toggle');
};
}
};
$dropDownMenu.dropdown();
$dropDownMenu.click(clickFunction($dropDownMenu));
$dropDownMenu.click(stopEventsBuble);
var $hierarchyGraph = $("<li>", { 'role' : 'presentation' }).append($("<a>", {'title' : 'Open Hierarchy'}).append("Open Hierarchy"));
$hierarchyGraph.click(function(e) {
$hierarchyGraph.click(function(event) {
stopEventsBuble(event);
mainController.changeView('showSampleHierarchyPage', data.permId, true);
});
$list.append($hierarchyGraph);
var $hierarchyTable = $("<li>", { 'role' : 'presentation' }).append($("<a>", {'title' : 'Open Hierarchy Table'}).append("Open Hierarchy Table"));
$hierarchyTable.click(function(e) {
$hierarchyTable.click(function(event) {
stopEventsBuble(event);
mainController.changeView('showSampleHierarchyTablePage', data.permId, true);
});
$list.append($hierarchyTable);
var $upload = $("<li>", { 'role' : 'presentation' }).append($("<a>", {'title' : 'File Upload'}).append("File Upload"));
$upload.click(function(e) {
$upload.click(function(event) {
stopEventsBuble(event);
mainController.changeView('showCreateDataSetPageFromPermId', data.permId, true);
});
$list.append($upload);
var $move = $("<li>", { 'role' : 'presentation' }).append($("<a>", {'title' : 'Move'}).append("Move"));
$move.click(function(e) {
$move.click(function(event) {
stopEventsBuble(event);
var moveSampleController = new MoveSampleController(data.permId, function() {
mainController.refreshView();
});
......
......@@ -303,20 +303,18 @@ function LinksView(linksController, linksModel) {
$dropDownMenu.append($caret);
$dropDownMenu.append($list);
var clickFunction = function($dropDown) {
return function(event) {
var stopEventsBuble = function(event) {
event.stopPropagation();
event.preventDefault();
$caret.dropdown('toggle');
};
}
};
$dropDownMenu.dropdown();
$dropDownMenu.click(clickFunction($dropDownMenu));
$dropDownMenu.click(stopEventsBuble);
if(profile.isSampleTypeProtocol(data["$object"].sampleTypeCode)) {
var $copyAndLink = $("<li>", { 'role' : 'presentation' }).append($("<a>", {'title' : 'Use as template'}).append("Use as template"));
$copyAndLink.click(function(e) {
stopEventsBuble(e);
var copyAndLink = function(code) {
var newSampleIdentifier = "/" + mainController.currentView._sampleFormModel.sample.spaceCode + "/" + code;
Util.blockUI();
......@@ -356,6 +354,7 @@ function LinksView(linksController, linksModel) {
var getDeleteFunc = function(sample) {
return function(e) {
stopEventsBuble(e);
linksView.updateSample(sample, false);
};
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment