|
|
@ -155,9 +155,8 @@ define('taskbar', ['benchpress', 'translator'], function (Benchpress, translator
|
|
|
|
|
|
|
|
|
|
|
|
var taskbarEl = $('<li />')
|
|
|
|
var taskbarEl = $('<li />')
|
|
|
|
.addClass(data.options.className)
|
|
|
|
.addClass(data.options.className)
|
|
|
|
.html('<a href="#">' +
|
|
|
|
.html('<a href="#"' + (data.options.image ? ' style="background-image: url(\'' + data.options.image + '\');"' : '') + '>' +
|
|
|
|
(data.options.icon ? '<i class="fa ' + data.options.icon + '"></i> ' : '') +
|
|
|
|
(data.options.icon ? '<i class="fa ' + data.options.icon + '"></i> ' : '') +
|
|
|
|
(data.options.image ? '<img src="' + data.options.image + '"/> ' : '') +
|
|
|
|
|
|
|
|
'<span component="taskbar/title">' + title + '</span>' +
|
|
|
|
'<span component="taskbar/title">' + title + '</span>' +
|
|
|
|
'</a>')
|
|
|
|
'</a>')
|
|
|
|
.attr({
|
|
|
|
.attr({
|
|
|
@ -182,7 +181,37 @@ define('taskbar', ['benchpress', 'translator'], function (Benchpress, translator
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var processUpdate = function (element, key, value) {
|
|
|
|
|
|
|
|
switch (key) {
|
|
|
|
|
|
|
|
case 'title':
|
|
|
|
|
|
|
|
element.find('[component="taskbar/title"]').text(value);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'icon':
|
|
|
|
|
|
|
|
element.find('i').attr('class', 'fa fa-' + value);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'image':
|
|
|
|
|
|
|
|
element.find('a').css('background-image', 'url("' + value + '")');
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'background-color':
|
|
|
|
|
|
|
|
element.find('a').css('background-color', value);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
taskbar.update = function (module, uuid, options) {
|
|
|
|
|
|
|
|
var element = taskbar.tasklist.find('[data-module="' + module + '"][data-uuid="' + uuid + '"]');
|
|
|
|
|
|
|
|
var data = element.data();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object.keys(options).forEach(function (key) {
|
|
|
|
|
|
|
|
data[key] = options[key];
|
|
|
|
|
|
|
|
processUpdate(element, key, options[key]);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
element.data(data);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
taskbar.updateTitle = function (module, uuid, newTitle) {
|
|
|
|
taskbar.updateTitle = function (module, uuid, newTitle) {
|
|
|
|
|
|
|
|
console.warn('[taskbar] .updateTitle() is deprecated, use .update() instead');
|
|
|
|
taskbar.tasklist.find('[data-module="' + module + '"][data-uuid="' + uuid + '"] [component="taskbar/title"]').text(newTitle);
|
|
|
|
taskbar.tasklist.find('[data-module="' + module + '"][data-uuid="' + uuid + '"] [component="taskbar/title"]').text(newTitle);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|