// TODO: Replace these with actual logic to update
// the UI without having to force a page reload.
- body.on(CalendarEvents.created, function() { window.location.reload(); });
- body.on(CalendarEvents.deleted, function() { window.location.reload(); });
- body.on(CalendarEvents.updated, function() { window.location.reload(); });
+ body.on(CalendarEvents.created, function() {
+ window.location.reload();
+ });
+ body.on(CalendarEvents.deleted, function() {
+ window.location.reload();
+ });
+ body.on(CalendarEvents.updated, function() {
+ window.location.reload();
+ });
eventFormModalPromise.then(function(modal) {
// When something within the calendar tells us the user wants
formElement.find(SELECTORS.EVENT_GROUP_ID)
.find(SELECTORS.SELECT_OPTION)
.each(function(index, element) {
- var element = $(element);
+ element = $(element);
var value = element.attr('value');
var splits = value.split('-');
var courseId = splits[0];
this.moreLessButton.attr('data-collapsed', 'true');
Str.get_string('more', 'calendar').then(function(string) {
this.moreLessButton.text(string);
+ return;
}.bind(this));
};
this.moreLessButton.attr('data-collapsed', 'false');
Str.get_string('less', 'calendar').then(function(string) {
this.moreLessButton.text(string);
+ return;
}.bind(this));
};
$('body').trigger(CalendarEvents.created, [response.event]);
}
}
+
+ return;
}.bind(this))
.always(function() {
// Regardless of success or error we should always stop
Modal.prototype.registerEventListeners.call(this);
var confirmPromise = ModalFactory.create(
- { type: ModalFactory.types.CONFIRM },
+ {
+ type: ModalFactory.types.CONFIRM
+ },
this.getDeleteButton()
).then(function(modal) {
modal.getRoot().on(ModalEvents.yes, function() {
$results = $DB->get_records_sql($sql, $params);
- /**
- * The results will come back as a flat dataset thanks to the left
- * join so we will need to do some post processing to blow it out
- * into a more usable data structure.
- *
- * This loop will extract the distinct groups from the result set
- * and add it's list of members to the object as a property called
- * 'members'. Then each group will be added to the result set indexed
- * by it's course id.
- *
- * The resulting data structure for $groups should be:
- * $groups = [
- * '1' = [
- * '1' => (object) [
- * 'id' => 1,
- * <rest of group properties>
- * 'members' => [
- * '1' => (object) [
- * <group member properties>
- * ],
- * '2' => (object) [
- * <group member properties>
- * ]
- * ]
- * ],
- * '2' => (object) [
- * 'id' => 2,
- * <rest of group properties>
- * 'members' => [
- * '1' => (object) [
- * <group member properties>
- * ],
- * '3' => (object) [
- * <group member properties>
- * ]
- * ]
- * ]
- * ]
- * ]
- */
+ // The results will come back as a flat dataset thanks to the left
+ // join so we will need to do some post processing to blow it out
+ // into a more usable data structure.
+ //
+ // This loop will extract the distinct groups from the result set
+ // and add it's list of members to the object as a property called
+ // 'members'. Then each group will be added to the result set indexed
+ // by it's course id.
+ //
+ // The resulting data structure for $groups should be:
+ // $groups = [
+ // '1' = [
+ // '1' => (object) [
+ // 'id' => 1,
+ // <rest of group properties>
+ // 'members' => [
+ // '1' => (object) [
+ // <group member properties>
+ // ],
+ // '2' => (object) [
+ // <group member properties>
+ // ]
+ // ]
+ // ],
+ // '2' => (object) [
+ // 'id' => 2,
+ // <rest of group properties>
+ // 'members' => [
+ // '1' => (object) [
+ // <group member properties>
+ // ],
+ // '3' => (object) [
+ // <group member properties>
+ // ]
+ // ]
+ // ]
+ // ]
+ // ]
+ //
foreach ($results as $key => $result) {
$groupid = $result->gid;
$courseid = $result->courseid;
@zindexFixedNavbar: 1030;
@zindexModalBackdrop: 1040;
@zindexModal: 1050;
-@zindexModalContainer: 4050;
// Sprite icons path
// -------------------------
@import "fontawesome/font-awesome";
@import "fontawesome/moodle-path";
+// Import the Moodle variables.
+@import "moodle/variables.less";
+
// Old Moodle stuff from base theme.
// Massive, needs broken up.
@import "moodle/core";
}
.modal-backdrop {
- z-index: 4049;
+ z-index: @zindexModalContainerBackdrop;
background-color: #aaa;
opacity: 0.4;
}
--- /dev/null
+// Global variables for use within Moodle's less style sheets.
+// These should be unique and not override the variables defined
+// in Bootstrap.
+
+@zindexModalContainer: 4050;
+@zindexModalContainerBackdrop: 4049;
+