Skip to content

Commit

Permalink
Add the kronolithEventLinkResources tab when first resource is added.
Browse files Browse the repository at this point in the history
If no resources are present when the ajax view loads, the tab is not
present. If we add a new resource, we must create the tab to avoid
having to reload the page completely.
  • Loading branch information
mrubinsk committed Mar 24, 2015
1 parent cbf3fa6 commit a6319e1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions kronolith/js/kronolith.js
Expand Up @@ -3837,6 +3837,11 @@ KronolithCore = {
if (type == 'remote') {
this.loadCalendar(type, id);
}
if (type == 'resource') {
if (!$('kronolithEventLinkResources')) {
this.addResourceTabLink();
}
}
}
form.down('.kronolithCalendarSave').enable();
this.closeRedBox();
Expand Down Expand Up @@ -6232,6 +6237,20 @@ KronolithCore = {
}.bind(this));
},

addResourceTabLink: function()
{
var l = new Element('li').insert(
new Element('a',
{
'href': '#',
className: 'kronolithTabLink',
id: 'kronolithEventLinkResources'
}).update(Kronolith.text.resources)
);
$('kronolithEventLinkAttendees').up().insert({ after: l });
Kronolith.conf.has_resources = true;
},

addResource: function(resource, id)
{
var v, response = 1;
Expand Down
1 change: 1 addition & 0 deletions kronolith/lib/Ajax.php
Expand Up @@ -150,6 +150,7 @@ protected function _addBaseVars()
'no_tasklist_title' => _("The task list title must not be empty."),
'no_url' => _("You must specify a URL."),
'prefs' => _("Preferences"),
'resources' => _("Resources"),
'searching' => sprintf(_("Events matching \"%s\""), '#{term}'),
'shared' => _("Shared"),
'tasks' => _("Tasks"),
Expand Down

0 comments on commit a6319e1

Please sign in to comment.