resources/www/scripts/auto-collapse.js
function (SRE,state) {
      var w = SRE.width, m = w, M = 1000000;
      for (var j = SRE.action.length-1; j >= 0; j--) {
        var action = SRE.action[j], selection = action.selection;
        if (w > SRE.cwidth) {
          action.selection = 1;
          m = action.SREwidth; M = w;
        } else {
          action.selection = 2;
        }
        w = action.SREwidth;
        if (SRE.DOMupdate) {
          document.getElementById(action.id).setAttribute("selection",action.selection);
        } else if (action.selection !== selection) {
          state.changed = true;
        }
      }
      SRE.m = m; SRE.M = M;
    }
function (SRE,state) {
      var w = SRE.width, m = w, M = 1000000;
      for (var j = SRE.action.length-1; j >= 0; j--) {
        var action = SRE.action[j], selection = action.selection;
        if (w > SRE.cwidth) {
          action.selection = 1;
          m = action.SREwidth; M = w;
        } else {
          action.selection = 2;
        }
        w = action.SREwidth;
        if (SRE.DOMupdate) {
          document.getElementById(action.id).setAttribute("selection",action.selection);
        } else if (action.selection !== selection) {
          state.changed = true;
        }
      }
      SRE.m = m; SRE.M = M;
    }
function ( SRE , state ) { var w = SRE . width , m = w , M = 1000000 ; for ( var j = SRE . action . length - 1 ; j >= 0 ; j -- ) { var action = SRE . action [ j ] , selection = action . selection ; if ( w > SRE . cwidth ) { action . selection = 1 ; m = action . SREwidth ; M = w ; } else { action . selection = 2 ; } w = action . SREwidth ; if ( SRE . DOMupdate ) { document . getElementById ( action . id ) . setAttribute ( "selection" , action . selection ) ; } else if ( action . selection !== selection ) { state . changed = true ; } } SRE . m = m ; SRE . M = M ; }
Find the actions that need to be collapsed to acheive the correct width, and retain the sizes that would cause the equation to be expanded or collapsed further.
Find the actions that need to be collapsed to acheive the correct width and retain the sizes that would cause the equation to be expanded or collapsed further .