SHARE
    TWEET
    Krenair

    OOjs UI LabeledElement configurable autoEllipsis patch

    Mar 13th, 2014
    243
    0
    Never
    Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
    Diff 1.43 KB | None | 0 0
    1. diff --git a/resources/oojs-ui/oojs-ui.js b/resources/oojs-ui/oojs-ui.js
    2. index 1f13047..1c42bbc 100644
    3. --- a/resources/oojs-ui/oojs-ui.js
    4. +++ b/resources/oojs-ui/oojs-ui.js
    5. @@ -2459,6 +2459,7 @@ OO.ui.IndicatedElement.prototype.getIndicatorTitle = function () {
    6. * @param {jQuery} $label Label node, assigned to #$label
    7. * @param {Object} [config] Configuration options
    8. * @cfg {jQuery|string|Function} [label] Label nodes, text or a function that returns nodes or text
    9. + * @cfg {bool} [autoEllipsis] Whether to use autoEllipsis when fitting the label or not. Defaults to true.
    10. */
    11. OO.ui.LabeledElement = function OoUiLabeledElement( $label, config ) {
    12. // Config intialization
    13. @@ -2471,6 +2472,7 @@ OO.ui.LabeledElement = function OoUiLabeledElement( $label, config ) {
    14. // Initialization
    15. this.$label.addClass( 'oo-ui-labeledElement-label' );
    16. this.setLabel( config.label || this.constructor.static.label );
    17. + this.autoEllipsis = config.autoEllipsis;
    18. };
    19. /* Static Properties */
    20. @@ -2541,7 +2543,7 @@ OO.ui.LabeledElement.prototype.getLabel = function () {
    21. * @chainable
    22. */
    23. OO.ui.LabeledElement.prototype.fitLabel = function () {
    24. - if ( this.$label.autoEllipsis ) {
    25. + if ( this.$label.autoEllipsis && ( this.autoEllipsis === undefined || this.autoEllipsis ) ) {
    26. this.$label.autoEllipsis( { 'hasSpan': false, 'tooltip': true } );
    27. }
    28. return this;
    Advertisement
    Add Comment
    Please, Sign In to add comment
    Public Pastes
    We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
    Not a member of Pastebin yet?
    Sign Up, it unlocks many cool features!

    AltStyle によって変換されたページ (->オリジナル) /