mirror of
https://github.com/friendica/friendica
synced 2025-03-22 06:59:37 +00:00
Change filer dialog from color box to modal usage
This commit is contained in:
parent
827541ed86
commit
01f852a87c
4 changed files with 22 additions and 16 deletions
|
@ -326,7 +326,7 @@ class Conversation
|
||||||
'$ispublic' => $this->l10n->t('Visible to <strong>everybody</strong>'),
|
'$ispublic' => $this->l10n->t('Visible to <strong>everybody</strong>'),
|
||||||
'$linkurl' => $this->l10n->t('Please enter a image/video/audio/webpage URL:'),
|
'$linkurl' => $this->l10n->t('Please enter a image/video/audio/webpage URL:'),
|
||||||
'$term' => $this->l10n->t('Tag term:'),
|
'$term' => $this->l10n->t('Tag term:'),
|
||||||
'$fileas' => $this->l10n->t('Save to Folder:'),
|
'$fileas' => $this->l10n->t('Save to Folder'),
|
||||||
'$whereareu' => $this->l10n->t('Where are you right now?'),
|
'$whereareu' => $this->l10n->t('Where are you right now?'),
|
||||||
'$delitems' => $this->l10n->t("Delete item\x28s\x29?"),
|
'$delitems' => $this->l10n->t("Delete item\x28s\x29?"),
|
||||||
'$is_mobile' => $this->mode->isMobile(),
|
'$is_mobile' => $this->mode->isMobile(),
|
||||||
|
|
|
@ -56,7 +56,7 @@ class SaveTag extends BaseModule
|
||||||
|
|
||||||
$tpl = Renderer::getMarkupTemplate("filer_dialog.tpl");
|
$tpl = Renderer::getMarkupTemplate("filer_dialog.tpl");
|
||||||
echo Renderer::replaceMacros($tpl, [
|
echo Renderer::replaceMacros($tpl, [
|
||||||
'$field' => ['term', $this->t("Save to Folder:"), '', '', $filetags, $this->t('- select -')],
|
'$field' => ['term', $this->t("Folder:"), '', '', $filetags, $this->t('- select -')],
|
||||||
'$submit' => $this->t('Save'),
|
'$submit' => $this->t('Save'),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
|
@ -7,5 +7,5 @@
|
||||||
|
|
||||||
{{include file="field_combobox.tpl"}}
|
{{include file="field_combobox.tpl"}}
|
||||||
<div class="settings-submit-wrapper">
|
<div class="settings-submit-wrapper">
|
||||||
<input id="filer_save" type="button" class="settings-submit" value="{{$submit}}" />
|
<input id="filer_save" type="button" class="btn btn-primary" value="{{$submit}}" />
|
||||||
</div>
|
</div>
|
|
@ -296,27 +296,33 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function itemFiler(id) {
|
function itemFiler(id) {
|
||||||
const bordercolor = $("input").css("border-color");
|
var modal = $('#modal').modal();
|
||||||
|
|
||||||
$.get('filer/', function (data) {
|
$.get('filer/', function (data) {
|
||||||
$.colorbox({html: data});
|
modal
|
||||||
$("#id_term").keypress(function () {
|
.find('#modal-body')
|
||||||
$(this).css("border-color", bordercolor);
|
.append(data);
|
||||||
})
|
|
||||||
$("#select_term").change(function () {
|
modal
|
||||||
$("#id_term").css("border-color", bordercolor);
|
.find('#modal-header h4')
|
||||||
})
|
.append("{{$fileas}}");
|
||||||
|
|
||||||
|
// Ensure focus after the modal is fully visible
|
||||||
|
modal.on('shown.bs.modal', function () {
|
||||||
|
$('#id_term').trigger('focus');
|
||||||
|
});
|
||||||
|
|
||||||
$("#filer_save").click(function (e) {
|
$("#filer_save").click(function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const reply = $("#id_term").val();
|
const term = $("#id_term").val();
|
||||||
if (reply && reply.length) {
|
if (term && term.length) {
|
||||||
commentBusy = true;
|
commentBusy = true;
|
||||||
formModified = true;
|
formModified = true;
|
||||||
$('body').css('cursor', 'wait');
|
$('body').css('cursor', 'wait');
|
||||||
$.get('filer/' + id + '?term=' + reply)
|
$.get('filer/' + id + '?term=' + term)
|
||||||
.done(function () {
|
.done(function () {
|
||||||
$.colorbox.close();
|
$('#modal-body').empty();
|
||||||
|
$('#modal').modal('hide');
|
||||||
resetFormModifiedFlag();
|
resetFormModifiedFlag();
|
||||||
})
|
})
|
||||||
.always(function () {
|
.always(function () {
|
||||||
|
|
Loading…
Add table
Reference in a new issue