|
@@ -269,10 +269,10 @@ $(function()
|
|
this.options.ymax = -9999;
|
|
this.options.ymax = -9999;
|
|
for(var k in this.aNodes)
|
|
for(var k in this.aNodes)
|
|
{
|
|
{
|
|
- this.options.xmin = Math.min(this.aNodes[k].x + this.aNodes[k].tx, this.options.xmin);
|
|
|
|
- this.options.xmax = Math.max(this.aNodes[k].x + this.aNodes[k].tx, this.options.xmax);
|
|
|
|
- this.options.ymin = Math.min(this.aNodes[k].y + this.aNodes[k].ty, this.options.ymin);
|
|
|
|
- this.options.ymax = Math.max(this.aNodes[k].y + this.aNodes[k].ty, this.options.ymax);
|
|
|
|
|
|
+ this.options.xmin = Math.min(this.aNodes[k].x + this.aNodes[k].tx - this.aNodes[k].width/2, this.options.xmin);
|
|
|
|
+ this.options.xmax = Math.max(this.aNodes[k].x + this.aNodes[k].tx + this.aNodes[k].width/2, this.options.xmax);
|
|
|
|
+ this.options.ymin = Math.min(this.aNodes[k].y + this.aNodes[k].ty - this.aNodes[k].width/2, this.options.ymin);
|
|
|
|
+ this.options.ymax = Math.max(this.aNodes[k].y + this.aNodes[k].ty + this.aNodes[k].width/2, this.options.ymax);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
_get_edge_path: function(oEdge)
|
|
_get_edge_path: function(oEdge)
|
|
@@ -617,8 +617,10 @@ $(function()
|
|
this.element.closest('.ui-tabs').tabs({ heightStyle: "fill" });
|
|
this.element.closest('.ui-tabs').tabs({ heightStyle: "fill" });
|
|
this._close_all_tooltips();
|
|
this._close_all_tooltips();
|
|
this.oPaper.rect(0, 0, this.element.width(), this.element.height()).attr({fill: '#000', opacity: 0.4, 'stroke-width': 0});
|
|
this.oPaper.rect(0, 0, this.element.width(), this.element.height()).attr({fill: '#000', opacity: 0.4, 'stroke-width': 0});
|
|
|
|
+ $('#'+sId+'_refresh_btn').button('disable');
|
|
$.post(sUrl, {excluded_classes: this.options.excluded_classes, g: this.options.grouping_threshold, sources: this.options.sources, excluded: this.options.excluded, contexts: aContexts, context_key: this.options.context_key }, function(data) {
|
|
$.post(sUrl, {excluded_classes: this.options.excluded_classes, g: this.options.grouping_threshold, sources: this.options.sources, excluded: this.options.excluded, contexts: aContexts, context_key: this.options.context_key }, function(data) {
|
|
me.load(data);
|
|
me.load(data);
|
|
|
|
+ $('#'+sId+'_refresh_btn').button('enable');
|
|
}, 'json');
|
|
}, 'json');
|
|
},
|
|
},
|
|
export_as_attachment: function()
|
|
export_as_attachment: function()
|
|
@@ -665,13 +667,22 @@ $(function()
|
|
$.post(sUrl, oParams, function(data) {
|
|
$.post(sUrl, oParams, function(data) {
|
|
var sDownloadLink = GetAbsoluteUrlAppRoot()+'pages/ajax.render.php?operation=download_document&class=Attachment&id='+data.att_id+'&field=contents';
|
|
var sDownloadLink = GetAbsoluteUrlAppRoot()+'pages/ajax.render.php?operation=download_document&class=Attachment&id='+data.att_id+'&field=contents';
|
|
var sIcon = GetAbsoluteUrlModulesRoot()+'itop-attachments/icons/pdf.png';
|
|
var sIcon = GetAbsoluteUrlModulesRoot()+'itop-attachments/icons/pdf.png';
|
|
- $('#attachments').append('<div class="attachment" id="display_attachment_'+data.att_id+'"><a data-preview="false" href="'+sDownloadLink+'"><img src="'+sIcon+'"><br/>'+sTitle+'.pdf<input id="attachment_'+data.att_id+'" type="hidden" name="attachments[]" value="'+data.att_id+'"/></a><br/><input type="button" class="btn_hidden" value="{$sDeleteBtn}" onClick="RemoveAttachment('+data.att_id+');"/></div>');
|
|
|
|
if (jTab != null)
|
|
if (jTab != null)
|
|
{
|
|
{
|
|
var re = /^([^(]+)\(([0-9]+)\)(.*)$/;
|
|
var re = /^([^(]+)\(([0-9]+)\)(.*)$/;
|
|
var aParts = re.exec(sTabText);
|
|
var aParts = re.exec(sTabText);
|
|
- var iPrevCount = parseInt(aParts[2], 10);
|
|
|
|
- jTab.find('span').html(aParts[1]+'('+(1 + iPrevCount)+')'+aParts[3]);
|
|
|
|
|
|
+ if (aParts == null)
|
|
|
|
+ {
|
|
|
|
+ // First attachment
|
|
|
|
+ $('#attachments').html('<div class="attachment" id="display_attachment_'+data.att_id+'"><a data-preview="false" href="'+sDownloadLink+'"><img src="'+sIcon+'"><br/>'+sTitle+'.pdf<input id="attachment_'+data.att_id+'" type="hidden" name="attachments[]" value="'+data.att_id+'"/></a><br/><input type="button" class="btn_hidden" value="{$sDeleteBtn}" onClick="RemoveAttachment('+data.att_id+');"/></div>');
|
|
|
|
+ jTab.find('span').html(sTabText +' (1)');
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ $('#attachments').append('<div class="attachment" id="display_attachment_'+data.att_id+'"><a data-preview="false" href="'+sDownloadLink+'"><img src="'+sIcon+'"><br/>'+sTitle+'.pdf<input id="attachment_'+data.att_id+'" type="hidden" name="attachments[]" value="'+data.att_id+'"/></a><br/><input type="button" class="btn_hidden" value="{$sDeleteBtn}" onClick="RemoveAttachment('+data.att_id+');"/></div>');
|
|
|
|
+ var iPrevCount = parseInt(aParts[2], 10);
|
|
|
|
+ jTab.find('span').html(aParts[1]+'('+(1 + iPrevCount)+')'+aParts[3]);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}, 'json');
|
|
}, 'json');
|
|
return false;
|
|
return false;
|
|
@@ -691,15 +702,15 @@ $(function()
|
|
return sTooltipContent;
|
|
return sTooltipContent;
|
|
},
|
|
},
|
|
items: '.popupMenuTarget',
|
|
items: '.popupMenuTarget',
|
|
|
|
+ tooltipClass: 'tooltip-simple-graph',
|
|
position: {
|
|
position: {
|
|
my: "center bottom-10",
|
|
my: "center bottom-10",
|
|
- at: "center top",
|
|
|
|
|
|
+ at: "center top",
|
|
using: function( position, feedback ) {
|
|
using: function( position, feedback ) {
|
|
$(this).css( position );
|
|
$(this).css( position );
|
|
$( "<div>" )
|
|
$( "<div>" )
|
|
.addClass( "arrow" )
|
|
.addClass( "arrow" )
|
|
.addClass( feedback.vertical )
|
|
.addClass( feedback.vertical )
|
|
- .addClass( feedback.horizontal )
|
|
|
|
.appendTo( this );
|
|
.appendTo( this );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -739,6 +750,11 @@ $(function()
|
|
var sDataId = $(this).attr('data-id');
|
|
var sDataId = $(this).attr('data-id');
|
|
$('.popupMenuTarget[data-id="'+sDataId+'"]').tooltip('close');
|
|
$('.popupMenuTarget[data-id="'+sDataId+'"]').tooltip('close');
|
|
});
|
|
});
|
|
|
|
+ this.element.on("click", ":not(.tooltip-simple-graph *,.tooltip-simple-graph)", function(){
|
|
|
|
+ $('.popupMenuTarget').each(function (i) {
|
|
|
|
+ $(this).tooltip("close");
|
|
|
|
+ });
|
|
|
|
+ });
|
|
},
|
|
},
|
|
_get_tooltip_content: function(sNodeId)
|
|
_get_tooltip_content: function(sNodeId)
|
|
{
|
|
{
|