mirror of
https://github.com/Combodo/iTop.git
synced 2026-03-16 22:44:13 +01:00
N°3914 Harmonize external key / linksets buttons style and positions on modals
This commit is contained in:
@@ -673,11 +673,9 @@ JS
|
||||
$sEmptyList = Dict::S('UI:Message:EmptyList:UseSearchForm');
|
||||
$oPage->add(<<<HTML
|
||||
<form id="fr_{$this->iId}" OnSubmit="return oACWidget_{$this->iId}.DoOk();">
|
||||
<div id="dr_{$this->iId}" style="vertical-align:top;background: #fff;height:100%;overflow:auto;padding:0;border:0;">
|
||||
<div style="background: #fff; border:0; text-align:center; vertical-align:middle;"><p>{$sEmptyList}</p></div>
|
||||
<div id="dr_{$this->iId}">
|
||||
<div><p>{$sEmptyList}</p></div>
|
||||
</div>
|
||||
<input type="button" id="btn_cancel_{$this->iId}" value="{$sCancel}" onClick="$('#ac_dlg_{$this->iId}').dialog('close');">
|
||||
<input type="button" id="btn_ok_{$this->iId}_results" value="{$sOK}" onClick="oACWidget_{$this->iId}.DoOk();">
|
||||
<input type="hidden" id="count_{$this->iId}_results" value="0">
|
||||
</form>
|
||||
</div></div>
|
||||
@@ -686,7 +684,27 @@ HTML
|
||||
|
||||
$sDialogTitle = addslashes($sTitle);
|
||||
$oPage->add_ready_script(<<<JS
|
||||
$('#ac_dlg_{$this->iId}').dialog({ width: $(window).width()*0.8, height: $(window).height()*0.8, autoOpen: false, modal: true, title: '$sDialogTitle', resizeStop: oACWidget_{$this->iId}.UpdateSizes, close: oACWidget_{$this->iId}.OnClose });
|
||||
$('#ac_dlg_{$this->iId}').dialog({
|
||||
width: $(window).width()*0.8,
|
||||
height: $(window).height()*0.8,
|
||||
autoOpen: false,
|
||||
modal: true,
|
||||
title: '$sDialogTitle',
|
||||
resizeStop: oACWidget_{$this->iId}.UpdateSizes,
|
||||
close: oACWidget_{$this->iId}.OnClose,
|
||||
buttons: [
|
||||
{ text: "$sCancel",
|
||||
class: "ibo-is-alternative ibo-is-neutral",
|
||||
click: function() {
|
||||
$(this).dialog('close');
|
||||
} },
|
||||
{ text: "$sOK",
|
||||
class: "ibo-is-regular ibo-is-primary",
|
||||
click: function() {
|
||||
oACWidget_{$this->iId}.DoOk();
|
||||
} },
|
||||
],
|
||||
});
|
||||
$('#fs_{$this->iId}').on('submit.uiAutocomplete', oACWidget_{$this->iId}.DoSearchObjects);
|
||||
$('#dc_{$this->iId}').resize(oACWidget_{$this->iId}.UpdateSizes);
|
||||
JS
|
||||
|
||||
@@ -341,7 +341,6 @@ class UILinksWidgetDirect
|
||||
<div style="background: #fff; border:0; text-align:center; vertical-align:middle;"><p>{$sEmptyList}</p></div>
|
||||
</div>
|
||||
<input type="hidden" id="count_{$this->sInputid}" value="0"/>
|
||||
<button type="button" class="cancel">{$sCancel}</button> <button type="button" class="ok" disabled="disabled">{$sAdd}</button>
|
||||
</form>
|
||||
HTML
|
||||
);
|
||||
|
||||
@@ -60,7 +60,7 @@ $(function()
|
||||
this.oButtons = {};
|
||||
for(k in aButtonsTypes)
|
||||
{
|
||||
this.oButtons[aButtonsTypes[k]] = $('<button type="button">' + this.options.labels[aButtonsTypes[k]] + '</button>');
|
||||
this.oButtons[aButtonsTypes[k]] = $('<button class="ibo-button ibo-is-regular ibo-is-neutral" type="button">' + this.options.labels[aButtonsTypes[k]] + '</button>');
|
||||
}
|
||||
this.indicator = $('<span></span>');
|
||||
this.inputToBeCreated = $('<input type="hidden" name="'+this.options.input_name+'_tbc" value="{}">');
|
||||
@@ -232,8 +232,6 @@ $(function()
|
||||
$('body').append(me.oDlg);
|
||||
me.oDlg.html(data);
|
||||
me.oDlg.find('form').removeAttr('onsubmit').bind('submit', function() { me._onSearchToAdd(); return false; } );
|
||||
me.oDlg.find('button.cancel').off('click').on('click', function() { me.oDlg.dialog('close'); } );
|
||||
me.oDlg.find('button.ok').off('click').on('click', function() { me._onDoAdd(); } );
|
||||
$('#SearchFormToAdd_'+me.id).resize(function() { me._onSearchDlgUpdateSize(); });
|
||||
|
||||
me.oDlg.dialog({
|
||||
@@ -244,7 +242,24 @@ $(function()
|
||||
maxHeight: $(window).height() - 50,
|
||||
position: { my: "center", at: "center", of: window },
|
||||
close: function() { me._onDlgClose(); },
|
||||
resizeStop: function() { me._onSearchDlgUpdateSize(); }
|
||||
resizeStop: function() { me._onSearchDlgUpdateSize(); },
|
||||
buttons: [
|
||||
{
|
||||
text: Dict.S('UI:Button:Cancel'),
|
||||
class: "cancel ibo-is-alternative ibo-is-neutral",
|
||||
click: function() {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
},
|
||||
{
|
||||
text: Dict.S('UI:Button:Add'),
|
||||
class: "ok ibo-is-regular ibo-is-primary",
|
||||
click: function() {
|
||||
me._onDoAdd();
|
||||
}
|
||||
},
|
||||
],
|
||||
|
||||
});
|
||||
me.indicator.html('');
|
||||
me.oButtons['add'].prop('disabled', false);
|
||||
@@ -369,11 +384,11 @@ $(function()
|
||||
{
|
||||
if (iCount > 0)
|
||||
{
|
||||
this.oDlg.find('button.ok').prop('disabled', false);
|
||||
this.oDlg.parent().find('button.ok').prop('disabled', false);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.oDlg.find('button.ok').prop('disabled', true);
|
||||
this.oDlg.parent().find('button.ok').prop('disabled', true);
|
||||
}
|
||||
},
|
||||
_onDoAdd:function()
|
||||
|
||||
@@ -44,15 +44,5 @@ class BlockObjectPickerDialog extends UIContentBlock
|
||||
|
||||
$oForm->AddSubBlock(InputUIBlockFactory::MakeForHidden("count_{$this->sLinkedSetId}", '0', "count_{$this->sLinkedSetId}"));
|
||||
|
||||
$oToolbar = ToolbarUIBlockFactory::MakeStandard(null, ['ibo-datatable--selection-validation-buttons-toolbar']);
|
||||
$this->AddSubBlock($oToolbar);
|
||||
$oRemoveButton = ButtonUIBlockFactory::MakeForCancel($sCancel, null, null, false);
|
||||
$oRemoveButton->SetOnClickJsCode("$('#dlg_{$this->sLinkedSetId}').dialog('close');");
|
||||
$oToolbar->AddSubBlock($oRemoveButton);
|
||||
|
||||
$oAddButton = ButtonUIBlockFactory::MakeForSecondaryAction($sAdd, null, null, false, "btn_ok_{$this->sLinkedSetId}");
|
||||
$oAddButton->SetIsDisabled(true)
|
||||
->SetOnClickJsCode("return oWidget{$this->iInputId}.DoAddObjects(this.id);");
|
||||
$oToolbar->AddSubBlock($oAddButton);
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,25 @@ $('#dlg_{{ oUIBlock.sLinkedSetId }}').dialog({
|
||||
title:"{{ 'UI:AddObjectsOf_Class_LinkedWith_Class'|dict_format(oUIBlock.sLinkedClassName, oUIBlock.sClassName) }}" ,
|
||||
autoOpen: false,
|
||||
modal: true,
|
||||
resizeStop: oWidget{{ oUIBlock.iInputId }}.UpdateSizes
|
||||
resizeStop: oWidget{{ oUIBlock.iInputId }}.UpdateSizes,
|
||||
buttons: [
|
||||
{
|
||||
text: "{{ 'UI:Button:Cancel'| dict_s }}",
|
||||
class: "ibo-is-alternative ibo-is-neutral",
|
||||
click: function() {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
},
|
||||
{
|
||||
text: "{{ 'UI:Button:Add'| dict_s }}",
|
||||
class: "ibo-is-regular ibo-is-primary",
|
||||
id: "btn_ok_{{ oUIBlock.sLinkedSetId }}",
|
||||
click: function() {
|
||||
return oWidget{{ oUIBlock.iInputId }}.DoAddObjects();
|
||||
}
|
||||
},
|
||||
],
|
||||
|
||||
});
|
||||
|
||||
$('#SearchFormToAdd_{{ oUIBlock.sLinkedSetId }} form').bind('submit.uilinksWizard', oWidget{{ oUIBlock.iInputId }}.SearchObjectsToAdd);
|
||||
|
||||
Reference in New Issue
Block a user