Tablepedia / V2-Beta

Issue tracking for Tablepedia V2
0 stars 0 forks source link

Windows Internet Explorer issues (Create and Edit) #93

Closed contreras-jorgev closed 8 years ago

contreras-jorgev commented 8 years ago

Looks like the "textarea" element is not behaving the same as in Safari & Chrome.

Also the buttons on the bottom (Create, comments, etc.) are not visible.

contreras-jorgev commented 8 years ago

parentElement is not defined (but parentNode is) ... then we try to use "insertBefore" and Javascript crashes ...

insertbefore

It looks like the code in edit-table.js (script):

var _replaceTableNameUI = function(formerTableEl, labelValue) {
    var newLabel = document.createElement('Label');
    var formerTableName = formerTableEl.innerText;
    newLabel.innerHTML = labelValue;

    var newInput = document.createElement('input');
    newInput.id = formerTableEl.id;
    newInput.value = formerTableName;
    newInput.setAttribute('am-table-name', '');
    newInput.setAttribute(FORMER_TABLE_NAME_DATA, formerTableName );

    formerTableEl.parentElement.replaceChild( newInput, formerTableEl );
    newInput.parentElement.insertBefore(newLabel, newInput);

    for( var i=0; i<2; i++ ) {
        var br = document.createElement('br');
        var next = newInput.nextSibling;
        next.parentElement.insertBefore(br,next);     <==== HERE !!!
    }

    return newInput;        
};

/*  Old code - IE11 fails on next.parentElement !!!
for (var i = 0; i < 2; i++) {
    var br = document.createElement('br');
    var next = newInput.nextSibling;
    next.parentElement.insertBefore(br, next);
}
*/

/* Fix */
var parent = newInput.parentElement;
for (var i = 0; i < 2; i++) {
    var br = document.createElement('br');
    var next = newInput.nextSibling;
    parent.insertBefore(br, next);
}
contreras-jorgev commented 8 years ago

On IE Edge, if we move the closing after the "edit-actions" section, the buttons and comments re-appear!

contreras-jorgev commented 8 years ago

Also, on Edge, the following fixes the weird font used on textarea:

Tablepedia.css:

html, textarea { /* Add textarea */ font-family: 'Open Sans', Verdana, sans-serif; color: #595959; font-size: 14px; }