// -------------------------------------------------------------------------- \\
// File: LabelView.js                                                         \\
// Module: View                                                               \\
// Requires: Core, View.js                                                    \\
// Author: Neil Jenkins                                                       \\
// License: © 2010–2013 Opera Software ASA. All rights reserved.              \\
// -------------------------------------------------------------------------- \\

"use strict";

( function ( NS ) {

var LabelView = NS.Class({

    Extends: NS.View,

    layerTag: 'span',

    value: '',
    tooltip: '',

    draw: function ( layer ) {
        layer.title = this.get( 'tooltip' );
        layer.textContent = this.get( 'value' );
    },

    propertyNeedsRedraw: function () {
        return LabelView.parent
            .propertyNeedsRedraw.apply( this, arguments );
    }.observes( 'className', 'layerStyles', 'tooltip', 'value' ),

    redrawTooltip: function ( layer ) {
        layer.title = this.get( 'tooltip' );
    },

    redrawValue: function ( layer ) {
        layer.textContent = this.get( 'value' );
    }
});

NS.LabelView = LabelView;

}( this.O ) );

@@ -601,537 +601,1995 @@
  %7B%0A%0A
-var LabelView = NS.Class(%7B%0A%0A    Extends: NS.View,%0A%0A    layerTag: 'span',%0A%0A    value: '',%0A    tooltip: '',%0A%0A    draw: function ( layer ) %7B%0A        layer.title = this.get( 'tooltip' );%0A        layer.textContent = this.get( 'value' );%0A    %7D,%0A%0A    propertyNeedsRedraw: function () %7B%0A        return LabelView.parent%0A            .propertyNeedsRedraw.apply( this, arguments );%0A    %7D.observes( 'className', 'layerStyles', 'tooltip', 'value' ),%0A%0A    redrawTooltip: function ( layer ) %7B%0A        layer.title = this.get( 'tooltip' );%0A    %7D,%0A
+/**%0A    Class: O.LabelView%0A%0A    Extends: O.View%0A%0A    A LabelView simply displays a string of text, and optionally has a tooltip.%0A    It's DOM structure is:%0A%0A        %3Cspan title=%22$%7Bview.tooltip%7D%22%3E$%7Bview.value%7D%3C/span%3E%0A%0A    Although you may often want to change the layer tag (e.g. to an %60h1%60 etc.)%0A*/%0Avar LabelView = NS.Class(%7B%0A%0A    Extends: NS.View,%0A%0A    /**%0A        Property: O.LabelView#layerTag%0A        Type: String%0A        Default: 'span'%0A%0A        Overrides default in %3CO.View#layerTag%3E.%0A    */%0A    layerTag: 'span',%0A%0A    /**%0A        Property: O.LabelView.value%0A        Type: String%0A        Default: ''%0A%0A        The text to display in the view.%0A    */%0A    value: '',%0A%0A    /**%0A        Property: O.LabelView#tooltip%0A        Type: String%0A        Default: ''%0A%0A        The tooltip for the view.%0A    */%0A    tooltip: '',%0A%0A    /**%0A        Method: O.LabelView#draw%0A%0A        Overridden to draw view. See %3CO.View#draw%3E.%0A    */%0A    draw: function ( layer ) %7B%0A        layer.title = this.get( 'tooltip' );%0A        layer.textContent = this.get( 'value' );%0A    %7D,%0A%0A    /**%0A        Method: O.LabelView#propertyNeedsRedraw%0A%0A        Overridden to observe extra properties requiring redraw.%0A        See %3CO.View#propertyNeedsRedraw%3E.%0A    */%0A    propertyNeedsRedraw: function () %7B%0A        return LabelView.parent%0A            .propertyNeedsRedraw.apply( this, arguments );%0A    %7D.observes( 'className', 'layerStyles', 'tooltip', 'value' ),%0A%0A    /**%0A        Method: O.LabelView#redrawTooltip%0A%0A        Parameters:%0A            layer - %7BElement%7D The DOM layer for the view.%0A%0A        Updates the title attribute on the DOM layer to match the tooltip%0A        property of the view.%0A    */%0A    redrawTooltip: function ( layer ) %7B%0A        layer.title = this.get( 'tooltip' );%0A    %7D,%0A%0A    /**%0A        Method: O.LabelView#redrawValue%0A%0A        Parameters:%0A            layer - %7BElement%7D The DOM layer for the view.%0A%0A        Updates the text content of the DOM layer to match the value property of%0A        the view.%0A    */
 %0A   

Add documentation for LabelView.