PageRenderTime 25ms CodeModel.GetById 16ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/src/cocktail/domElement/js/TextDOMElement.hx

http://github.com/silexlabs/Cocktail
Haxe | 48 lines | 18 code | 3 blank | 27 comment | 0 complexity | c273f5cd0b79ab5a5f84435a03075fe4 MD5 | raw file
 1/*
 2This file is part of Silex - see http://projects.silexlabs.org/?/silex
 3
 4Silex is Š 2010-2011 Silex Labs and is released under the GPL License:
 5
 6This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (GPL) as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 
 7
 8This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 9
10To read the license please visit http://www.gnu.org/copyleft/gpl.html
11*/
12package cocktail.domElement.js;
13import cocktail.nativeElement.NativeElement;
14import js.Dom;
15import js.Lib;
16import cocktail.domElement.abstract.AbstractTextDOMElement;
17
18/**
19 * This is the JavaScript implementation for the Text DOMElement
20 * 
21 * It adds the JavaScript specific behaviour of setting the HTML
22 * of the reference to native DOM object
23 * 
24 * @author Yannick DOMINGUEZ
25 */
26class TextDOMElement extends AbstractTextDOMElement
27{
28	/**
29	 * class constructor
30	 */
31	public function new(nativeElement:NativeElement = null) 
32	{
33		super(nativeElement);
34	}
35	
36	/**
37	 * Set the innerHTML of the reference to the native
38	 * HTML tag with the provided text
39	 * @param	text an HTML formatted text
40	 */
41	override public function setText(text:String):String
42	{
43		super.setText(text);
44		this._nativeElement.innerHTML = text;
45		return text;
46	}
47	
48}