Skip to content

Commit

Permalink
changed disabled to isDisabled to not conflict with global html attri…
Browse files Browse the repository at this point in the history
…butes
  • Loading branch information
brenthosie committed Jun 24, 2015
1 parent e295073 commit 7f6c85c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions clearable-input.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<link rel="import" href="../polymer/polymer.html"/>
<link rel="import" href="../core-icons/core-icons.html">

<polymer-element name="clearable-input" attributes="placeholder value readonly disabled backgroundColor color icon">
<polymer-element name="clearable-input" attributes="placeholder value readonly isDisabled backgroundColor color icon">
<template>
<style>
span.wrapper {
Expand Down Expand Up @@ -106,14 +106,14 @@
this.$.textInput.readOnly = (this.readonly !== void 0);
/**
* If set on the element, makes the text input disabled. The text input will not be clearable.
* Disabled overrides readonly.
* isDisabled overrides readonly.
*
* @attribute disabled
* @attribute isDisabled
* @access public
* @type boolean
* @default undefined
*/
this.$.textInput.disabled = (this.disabled !== void 0);
this.$.textInput.disabled = (this.isDisabled !== void 0);
/**
* The core-icon that's used for clearing the input text
*
Expand All @@ -127,22 +127,22 @@
}

setInterval(function() {
this.clearHidden = this.$.textInput.value.length === 0 || this.disabled !== void 0;
this.clearHidden = this.$.textInput.value.length === 0 || this.isDisabled !== void 0;
}.bind(this), 100);


},

/**
* Tests whether or not clicking on the clear button should clear the value.
* Returns true if the disabled attribute is not set, false otherwise.
* Returns true if the isDisabled attribute is not set, false otherwise.
*
* function testClearInput
* access public
* returns boolean
*/
testClearInput: function() {
if(this.disabled === void 0) {
if(this.isDisabled === void 0) {
this.clearInput();
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

<div>
<p>Disabled input</p>
<clearable-input placeholder="Hello World" value="Foo" disabled></clearable-input>
<clearable-input placeholder="Hello World" value="Foo" isDisabled></clearable-input>
</div>

<div>
Expand Down

0 comments on commit 7f6c85c

Please sign in to comment.