Skip to content

Commit

Permalink
Fix #579 [MS Edge] Can't insert anything in the editor
Browse files Browse the repository at this point in the history
  • Loading branch information
neexite committed Jun 27, 2018
1 parent 8a926bd commit 317f3ad
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Website/Composite/scripts/source/top/ui/bindings/Binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,9 @@ Binding.prototype.subTreeFromString = function ( markup ) {
*/
Binding.prototype.getProperty = function ( attname ) {

var value = this.bindingElement.getAttribute ( attname );
// MS Edge 42 supports only lowercased attributes. It does not return attribute value for attribute name with capital letters.
var value = this.bindingElement.getAttribute ( Client.isEdge ? attname.toLowerCase() : attname );

if ( value ) {
value = Types.castFromString ( value );
}
Expand Down Expand Up @@ -969,9 +971,9 @@ Binding.prototype.setProperty = function ( prop, value ) {
* This will prevent recursive calls to methods which in turn
* modifies the properties of the binding.
*/
if ( String ( this.bindingElement.getAttribute ( prop )) != value ) {
if ( String ( this.bindingElement.getAttribute ( Client.isEdge ? prop.toLowerCase() : prop )) != value ) {

this.bindingElement.setAttribute ( prop, value );
this.bindingElement.setAttribute ( Client.isEdge ? prop.toLowerCase() : prop, value );
if ( this.isAttached == true ) {

/*
Expand Down Expand Up @@ -1008,7 +1010,7 @@ Binding.prototype.setProperty = function ( prop, value ) {
*/
Binding.prototype.deleteProperty = function ( prop ) {

this.bindingElement.removeAttribute ( prop );
this.bindingElement.removeAttribute ( Client.isEdge ? prop.toLowerCase() : prop );
}

/**
Expand Down

2 comments on commit 317f3ad

@nuFaqtz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just my 2 cents...
I'm guessing there's no need to check for 'isEdge', just always use 'prop.toLowercase()' as in all other browser engines the 'Attribute' methods are case insensitive.

@mawtex
Copy link
Collaborator

@mawtex mawtex commented on 317f3ad Jun 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nuFaqtz thanks for the input, fixed in 0947337

Please sign in to comment.