(js) Improve condition in CalendarListController
This commit is contained in:
parent
f161cbe56b
commit
bb88643568
|
@ -87,31 +87,31 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function openEvent($event, event) {
|
function openEvent($event, event) {
|
||||||
if (event.viewable)
|
openComponent($event, event, 'appointment');
|
||||||
openComponent($event, event, 'appointment');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function openTask($event, task) {
|
function openTask($event, task) {
|
||||||
if (task.viewable)
|
openComponent($event, task, 'task');
|
||||||
openComponent($event, task, 'task');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function openComponent($event, component, type) {
|
function openComponent($event, component, type) {
|
||||||
// UI/Templates/SchedulerUI/UIxAppointmentViewTemplate.wox or
|
if (component.viewable) {
|
||||||
// UI/Templates/SchedulerUI/UIxTaskViewTemplate.wox
|
// UI/Templates/SchedulerUI/UIxAppointmentViewTemplate.wox or
|
||||||
var templateUrl = 'UIx' + type.capitalize() + 'ViewTemplate';
|
// UI/Templates/SchedulerUI/UIxTaskViewTemplate.wox
|
||||||
$mdDialog.show({
|
var templateUrl = 'UIx' + type.capitalize() + 'ViewTemplate';
|
||||||
parent: angular.element(document.body),
|
$mdDialog.show({
|
||||||
targetEvent: $event,
|
parent: angular.element(document.body),
|
||||||
clickOutsideToClose: true,
|
targetEvent: $event,
|
||||||
escapeToClose: true,
|
clickOutsideToClose: true,
|
||||||
templateUrl: templateUrl,
|
escapeToClose: true,
|
||||||
controller: 'ComponentController',
|
templateUrl: templateUrl,
|
||||||
controllerAs: 'editor',
|
controller: 'ComponentController',
|
||||||
locals: {
|
controllerAs: 'editor',
|
||||||
stateComponent: component
|
locals: {
|
||||||
}
|
stateComponent: component
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function newComponent($event, baseComponent) {
|
function newComponent($event, baseComponent) {
|
||||||
|
|
Loading…
Reference in a new issue