Fix small UI issues and IE issues

This commit is contained in:
yflory
2018-03-02 18:33:43 +01:00
parent b7b560fcb8
commit b0dba481d8
14 changed files with 126 additions and 68 deletions

View File

@@ -668,7 +668,6 @@ define([
position: 'bottom',
distance: 0,
performance: true,
dynamicTitle: true,
delay: [delay, 0],
sticky: true
});
@@ -691,6 +690,9 @@ define([
mutations.forEach(function(mutation) {
if (mutation.type === "childList") {
for (var i = 0; i < mutation.addedNodes.length; i++) {
if ($(mutation.addedNodes[i]).attr('title')) {
addTippy(0, mutation.addedNodes[i]);
}
$(mutation.addedNodes[i]).find('[title]').each(addTippy);
}
for (var j = 0; j < mutation.removedNodes.length; j++) {

View File

@@ -588,7 +588,6 @@ define([
return;
});
});
});
break;
case 'present':
@@ -1777,7 +1776,7 @@ define([
var $body = $('body');
var $creationContainer = $('<div>', { id: 'cp-creation-container' }).appendTo($body);
var $creation = $('<div>', { id: 'cp-creation' }).appendTo($creationContainer);
var $creation = $('<div>', { id: 'cp-creation', tabindex: 1 }).appendTo($creationContainer);
var setHTML = function (e, html) {
e.innerHTML = html;
@@ -1980,6 +1979,29 @@ define([
$ok[0],
$spinner[0]
])).appendTo($creation);
var selected = -1;
var next = function () {
selected = ++selected % $creation.find('button').length;
$creation.find('button').removeClass('cp-creation-button-selected');
$($creation.find('button').get(selected)).addClass('cp-creation-button-selected');
};
$creation.keydown(function (e) {
if (e.which === 9) {
e.preventDefault();
e.stopPropagation();
next();
return;
}
if (e.which === 13) {
if ($creation.find('.cp-creation-button-selected').length === 1) {
$creation.find('.cp-creation-button-selected').click();
}
return;
}
});
$creation.focus();
};
UIElements.onServerError = function (common, err, toolbar, cb) {

View File

@@ -116,6 +116,7 @@ define([
/* remove listeners from the DOM */
var removeListeners = function (root) {
if (!root) { return; }
slice(root.attributes).map(function (attr) {
if (/^on/i.test(attr.name)) {
console.log('removing attribute', attr.name, root.attributes[attr.name]);
@@ -171,7 +172,9 @@ define([
return mt + '</media-tag>';
});
var safe_newHtmlFixed = domFromHTML(unsafe_newHtmlFixed).body.outerHTML;
var newDomFixed = domFromHTML(unsafe_newHtmlFixed);
if (!newDomFixed || !newDomFixed.body) { return; }
var safe_newHtmlFixed = newDomFixed.body.outerHTML;
var $div = $('<div>', {id: id}).append(safe_newHtmlFixed);
var Dom = domFromHTML($('<div>').append($div).html());

View File

@@ -318,7 +318,7 @@ define([
$span.append($rightCol);
} else {
Common.displayAvatar($span, data.avatar, name, function ($img) {
if (data.avatar && $img.length) {
if (data.avatar && $img && $img.length) {
avatars[data.avatar] = $img[0].outerHTML;
}
$span.append($rightCol);
@@ -610,7 +610,7 @@ define([
});
});
$('.cp-toolbar-top').append($msg);
UI.addTooltips();
//UI.addTooltips();
});
};