src/basis/dom/wrapper.js
function(selected, multiple){
      var selection = this.contextSelection;

      selected = !!resolveValue(this, this.setSelected, selected, 'selectedRA_');

      // special case, when node selected and has selection context check only
      // resolve adapter influence on selected if exists, and restore selection
      // influence when no resolve adapter
      if (this.selected && selection)
      {
        if (this.selectedRA_)
        {
          if (selection.has(this))
          {
            this.selected = false;
            selection.remove(this);
            this.selected = true;
          }
        }
        else
        {
          if (!selection.has(this))
            selection.add(this);
        }
      }

      if (selected !== this.selected)
      {
        if (this.selectedRA_) // when resolveValue using ignore selection
        {
          this.selected = selected;
          if (selected)
            this.emit_select();
          else
            this.emit_unselect();
        }
        else
        {
          if (selected) // this.selected = false -> true
          {
            if (selection)
            {
              if (multiple)
                selection.add(this);
              else
                selection.set(this);
            }
            else
            {
              this.selected = true;
              this.emit_select();
            }
          }
          else // this.selected = true -> false
          {
            if (selection)
            {
              selection.remove(this);
            }
            else
            {
              this.selected = false;
              this.emit_unselect();
            }
          }
        }

        return true;
      }
      else
      {
        if (!this.selectedRA_ && selected && selection)  // this.selected = true -> true
        {
          if (multiple)
            selection.remove(this);
          else
            selection.set(this);
        }
      }

      return false;
    }
function(selected, multiple){
      var selection = this.contextSelection;

      selected = !!resolveValue(this, this.setSelected, selected, 'selectedRA_');

      // special case, when node selected and has selection context check only
      // resolve adapter influence on selected if exists, and restore selection
      // influence when no resolve adapter
      if (this.selected && selection)
      {
        if (this.selectedRA_)
        {
          if (selection.has(this))
          {
            this.selected = false;
            selection.remove(this);
            this.selected = true;
          }
        }
        else
        {
          if (!selection.has(this))
            selection.add(this);
        }
      }

      if (selected !== this.selected)
      {
        if (this.selectedRA_) // when resolveValue using ignore selection
        {
          this.selected = selected;
          if (selected)
            this.emit_select();
          else
            this.emit_unselect();
        }
        else
        {
          if (selected) // this.selected = false -> true
          {
            if (selection)
            {
              if (multiple)
                selection.add(this);
              else
                selection.set(this);
            }
            else
            {
              this.selected = true;
              this.emit_select();
            }
          }
          else // this.selected = true -> false
          {
            if (selection)
            {
              selection.remove(this);
            }
            else
            {
              this.selected = false;
              this.emit_unselect();
            }
          }
        }

        return true;
      }
      else
      {
        if (!this.selectedRA_ && selected && selection)  // this.selected = true -> true
        {
          if (multiple)
            selection.remove(this);
          else
            selection.set(this);
        }
      }

      return false;
    }
function ( selected , multiple ) { var selection = this . contextSelection ; selected = ! ! resolveValue ( this , this . setSelected , selected , 'selectedRA_' ) ; // special case, when node selected and has selection context check only // resolve adapter influence on selected if exists, and restore selection // influence when no resolve adapter if ( this . selected && selection ) { if ( this . selectedRA_ ) { if ( selection . has ( this ) ) { this . selected = false ; selection . remove ( this ) ; this . selected = true ; } } else { if ( ! selection . has ( this ) ) selection . add ( this ) ; } } if ( selected !== this . selected ) { if ( this . selectedRA_ ) // when resolveValue using ignore selection { this . selected = selected ; if ( selected ) this . emit_select ( ) ; else this . emit_unselect ( ) ; } else { if ( selected ) // this.selected = false -> true { if ( selection ) { if ( multiple ) selection . add ( this ) ; else selection . set ( this ) ; } else { this . selected = true ; this . emit_select ( ) ; } } else // this.selected = true -> false { if ( selection ) { selection . remove ( this ) ; } else { this . selected = false ; this . emit_unselect ( ) ; } } } return true ; } else { if ( ! this . selectedRA_ && selected && selection ) // this.selected = true -> true { if ( multiple ) selection . remove ( this ) ; else selection . set ( this ) ; } } return false ; }
Set new value for selected property.
@param {boolean} selected Should be node selected or not.
@param {boolean} multiple Apply new state in multiple select mode or not.
@return {boolean} Returns true if selected property was changed.
Set new value for selected property .