Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 76954200BD4 for ; Wed, 26 Oct 2016 22:49:13 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7552A160B06; Wed, 26 Oct 2016 20:49:13 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4549B160B07 for ; Wed, 26 Oct 2016 22:49:12 +0200 (CEST) Received: (qmail 25582 invoked by uid 500); 26 Oct 2016 20:49:10 -0000 Mailing-List: contact commits-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list commits@flex.apache.org Received: (qmail 25308 invoked by uid 99); 26 Oct 2016 20:49:10 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Oct 2016 20:49:10 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7980CF16D1; Wed, 26 Oct 2016 20:49:10 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: carlosrovira@apache.org To: commits@flex.apache.org Date: Wed, 26 Oct 2016 20:49:26 -0000 Message-Id: <359be3b0391643f9982eb35214ab878e@git.apache.org> In-Reply-To: <0d1924bdd5b040ffada3a5fa72e85aad@git.apache.org> References: <0d1924bdd5b040ffada3a5fa72e85aad@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [17/24] git commit: [flex-asjs] [refs/heads/feature/mdl] - Changes in TextInput archived-at: Wed, 26 Oct 2016 20:49:13 -0000 Changes in TextInput Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/9ac907eb Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/9ac907eb Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/9ac907eb Branch: refs/heads/feature/mdl Commit: 9ac907eb322a4c1da70537c6cba9c3b56612578e Parents: d9713a4 Author: Carlos Rovira Authored: Tue Oct 25 19:02:37 2016 +0200 Committer: Carlos Rovira Committed: Wed Oct 26 22:48:24 2016 +0200 ---------------------------------------------------------------------- .../flexjs/MDLExample/src/main/flex/App.mxml | 13 +++-- .../main/flex/org/apache/flex/mdl/TextInput.as | 55 ++++++-------------- 2 files changed, 21 insertions(+), 47 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9ac907eb/examples/flexjs/MDLExample/src/main/flex/App.mxml ---------------------------------------------------------------------- diff --git a/examples/flexjs/MDLExample/src/main/flex/App.mxml b/examples/flexjs/MDLExample/src/main/flex/App.mxml index a50dbeb..3924dba 100644 --- a/examples/flexjs/MDLExample/src/main/flex/App.mxml +++ b/examples/flexjs/MDLExample/src/main/flex/App.mxml @@ -55,16 +55,15 @@ limitations under the License. - - - + + - - + + - - + + http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9ac907eb/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextInput.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextInput.as b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextInput.as index b387b81..87f9c5a 100644 --- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextInput.as +++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TextInput.as @@ -64,41 +64,34 @@ package org.apache.flex.mdl COMPILE::JS override protected function createElement():WrappedHTMLElement { - var div:HTMLDivElement; - var input:HTMLInputElement; - var label:HTMLLabelElement; - var textNode:Text; - - div = document.createElement('div') as HTMLDivElement; + var div:HTMLDivElement = document.createElement('div') as HTMLDivElement; + div.className = "mdl-textfield mdl-js-textfield"; - input = document.createElement('input') as HTMLInputElement; + var input:HTMLInputElement = document.createElement('input') as HTMLInputElement; input.setAttribute('type', 'text'); input.className = 'mdl-textfield__input'; - - label = document.createElement('label') as HTMLLabelElement; - label.className = "mdl-textfield__label"; - _textNode = textNode = document.createTextNode('') as Text; + //attach input handler to dispatch flexjs change event when user write in textinput + //goog.events.listen(element, 'change', killChangeHandler); + goog.events.listen(input, 'input', textChangeHandler); + + var label:HTMLLabelElement = document.createElement('label') as HTMLLabelElement; + label.className = "mdl-textfield__label"; + + var textNode:Text = document.createTextNode('') as Text; label.appendChild(textNode); div.appendChild(input); div.appendChild(label); - element = div as WrappedHTMLElement; - - //attach input handler to dispatch flexjs change event when user write in textinput - //goog.events.listen(element, 'change', killChangeHandler); - goog.events.listen(input, 'input', textChangeHandler); - - positioner = element; + element = input as WrappedHTMLElement; + + positioner = div as WrappedHTMLElement; positioner.style.position = 'relative'; - (div as WrappedHTMLElement).flexjs_wrapper = this; (input as WrappedHTMLElement).flexjs_wrapper = this; (label as WrappedHTMLElement).flexjs_wrapper = this; element.flexjs_wrapper = this; - className = typeNames = "mdl-textfield mdl-js-textfield"; - return element; } @@ -114,26 +107,8 @@ package org.apache.flex.mdl _mdlEffect = value; COMPILE::JS { - className = _mdlEffect; + positioner.className = positioner.className + " " + _mdlEffect; } } - - /** - * @private - */ - override public function set text(value:String):void - { - //COMPILE::SWF - //{ - //inSetter = true; - //ITextModel(model).text = value; - //inSetter = false; - //} - COMPILE::JS - { - _textNode.nodeValue = value; - dispatchEvent(new Event('textChange')); - } - } } }