-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(admin-ui): js in edit revision (DateTime, Reorder, Sortable,…
… ..) (#770)
- Loading branch information
Showing
15 changed files
with
235 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict' | ||
import queryString from '../helpers/queryString' | ||
import { Modal as BSModal } from 'bootstrap' | ||
|
||
export default class Modal { | ||
constructor () { | ||
this.autoOpenModal() | ||
} | ||
|
||
autoOpenModal () { | ||
const queryStringObject = queryString() | ||
if (queryStringObject.open) { | ||
const modalElement = document.getElementById(`content_type_structure_fieldType${queryStringObject.open}`) | ||
const modal = BSModal.getOrCreateInstance(modalElement) | ||
modal.show() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { TempusDominus } from '@eonasdan/tempus-dominus' | ||
import '@eonasdan/tempus-dominus/src/scss/tempus-dominus.scss' | ||
import ChangeEvent from '../events/changeEvent' | ||
|
||
class Datetime { | ||
#iframes = [] | ||
|
||
load (target) { | ||
const datetimePickers = target.querySelectorAll('.datetime-picker') | ||
for (let i = 0; i < datetimePickers.length; i++) { | ||
const picker = new TempusDominus(datetimePickers[i], { | ||
display: { | ||
buttons: { | ||
today: true, | ||
clear: true, | ||
close: true | ||
} | ||
}, | ||
localization: { | ||
format: datetimePickers[i].dataset.dateFormat, | ||
startOfTheWeek: 1 | ||
}, | ||
restrictions: { | ||
daysOfWeekDisabled: JSON.parse(datetimePickers[i].dataset.dateDaysOfWeekDisabled), | ||
disabledHours: JSON.parse(datetimePickers[i].dataset.dateDisabledHours) | ||
} | ||
}) | ||
if (datetimePickers[i].dataset.dateLocale) { | ||
picker.locale(datetimePickers[i].dataset.dateLocale) | ||
} | ||
datetimePickers[i].addEventListener('change.td', function () { | ||
if (datetimePickers[i].classList.contains('ignore-ems-update')) { | ||
return | ||
} | ||
const event = new ChangeEvent(datetimePickers[i]) | ||
event.dispatch() | ||
}) | ||
} | ||
} | ||
} | ||
|
||
export default Datetime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.