mirror of
https://github.com/UnickSoft/graphonline.git
synced 2025-07-03 08:15:38 +00:00
Change create edge dialog.
This commit is contained in:
parent
d70c3d27e5
commit
1b3d8d72bc
@ -84,18 +84,37 @@
|
||||
width : 100%;
|
||||
}
|
||||
|
||||
#EdgeWeightControls
|
||||
{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#EdgeWeight
|
||||
{
|
||||
width: 86px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#EdgeWeightSlider
|
||||
{
|
||||
width: auto;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#MainEdgeWeightControl
|
||||
{
|
||||
border-width: 1px;
|
||||
border-radius: 4px;
|
||||
border-color: lightgray;
|
||||
border-style: solid;
|
||||
margin: 4px;
|
||||
padding: 6px;
|
||||
}
|
||||
|
||||
#EdgeLable {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#sentAlgorithm
|
||||
{
|
||||
display: none;
|
||||
|
@ -655,7 +655,6 @@ ConnectionGraphHandler.prototype.AddNewEdge = function(selectedObject, isDirect)
|
||||
{
|
||||
this.app.CreateNewArc(this.firstObject, selectedObject, isDirect, document.getElementById('EdgeWeight').value, $("#RadiosReplaceEdge").prop("checked"), document.getElementById('EdgeLable').value);
|
||||
|
||||
EdgeLable
|
||||
this.SelectFirst();
|
||||
this.app.NeedRedraw();
|
||||
}
|
||||
@ -719,6 +718,16 @@ ConnectionGraphHandler.prototype.SelectVertex = function(selectedObject)
|
||||
$(this).off('submit').on('submit', function () {
|
||||
return false;
|
||||
});
|
||||
|
||||
// Focues weight
|
||||
setTimeout(function(){
|
||||
const weightInput = document.getElementById('EdgeWeight');
|
||||
if(weightInput)
|
||||
{
|
||||
weightInput.focus();
|
||||
weightInput.select();
|
||||
}
|
||||
},0);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
31
tpl/home.php
31
tpl/home.php
@ -10,7 +10,7 @@
|
||||
|
||||
<script src="<?= Root('i/js/dev/jquery-ui.js')?>"></script>
|
||||
<script src="<?= Root('i/js/dev/jquery.feedback_me.js')?>"></script>
|
||||
<script src="<?= Root("script/example.js?v=42")?>" ></script>
|
||||
<script src="<?= Root("script/example.js?v=43")?>" ></script>
|
||||
</head>
|
||||
<!--
|
||||
<div class="pull-right">
|
||||
@ -229,16 +229,27 @@
|
||||
<div id="addEdge">
|
||||
<form>
|
||||
<fieldset>
|
||||
<div id="EdgeWeightControls">
|
||||
<label id="WeightLabel"><?= L('edge_weight')?> </label> <input type="range" id="EdgeWeightSlider" min="0" max="29" value="0" oninput="document.getElementById('EdgeWeight').value = (this.value > 0 ? this.value : '<?= L('default_weight')?>');" onchange="document.getElementById('EdgeWeight').value = (this.value > 0 ? this.value : '<?= L('default_weight')?>');"> <input type="text" name="edgeWeight" value="<?= L('default_weight')?>" id="EdgeWeight" class="inputBox">
|
||||
</div>
|
||||
<div id="MainEdgeWeightControl">
|
||||
<table id="EdgeWeightControls">
|
||||
<tr>
|
||||
<td rowspan="2">
|
||||
<label id="WeightLabel"><?= L('edge_weight')?> </label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="edgeWeight" value="<?= L('default_weight')?>" id="EdgeWeight" class="inputBox">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="range" id="EdgeWeightSlider" min="0" max="29" value="0" oninput="document.getElementById('EdgeWeight').value = (this.value > 0 ? this.value : '<?= L('default_weight')?>');" onchange="document.getElementById('EdgeWeight').value = (this.value > 0 ? this.value : '<?= L('default_weight')?>');">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="EdgesPresets">
|
||||
<span onClick="document.getElementById('EdgeWeight').value='<?= L('default_weight')?>'; document.getElementById('EdgeWeightSlider').value=0;" style="cursor: pointer" class="defaultWeigth"><?= L('default_weight')?></span>
|
||||
<span onClick="document.getElementById('EdgeWeight').value='1'; document.getElementById('EdgeWeightSlider').value=1;" style="cursor: pointer" class="defaultWeigth">1</span>
|
||||
</div>
|
||||
<div id="EdgeLabelControls">
|
||||
<label id="EdgeLabel"><?= L('text_above_edge')?></label> <input type="text" name="edgeLable" value="" id="EdgeLable" class="inputBox">
|
||||
</div>
|
||||
</div>
|
||||
<div id="NewEdgeAction">
|
||||
<div class="InlineStyle PaddingRight">
|
||||
<input class="form-check-input" type="radio" name="NewEdgeActionValue" id="RadiosReplaceEdge" value="replace" checked>
|
||||
@ -253,6 +264,12 @@
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<small>
|
||||
<div id="EdgeLabelControls">
|
||||
<label id="EdgeLabel"><?= L('text_above_edge')?></label> <input type="text" name="edgeLable" value="" id="EdgeLable" class="inputBox">
|
||||
</div>
|
||||
</small>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user