lib/js/PageView.js
function(e) {
      var t = this,
          box = t.getComponentArea(),
          sidebarWidth = t.sidebar.width(),
          canvasWidth = t.$el.width() - sidebarWidth,
          canvasCenter = canvasWidth / 2;

      // No components
      if (!box.width) {return;}

      // Obtain the center point, and offset the canvas by the difference
      // Keep the left margin at multiples of 10 to match components
      var componentCenter = box.left + (box.width / 2);
      var newLeft = sidebarWidth + Math.max(0, canvasCenter - componentCenter);
      newLeft = newLeft - newLeft % 10;
      t.canvas.css({marginLeft: newLeft});
    }
function(e) {
      var t = this,
          box = t.getComponentArea(),
          sidebarWidth = t.sidebar.width(),
          canvasWidth = t.$el.width() - sidebarWidth,
          canvasCenter = canvasWidth / 2;

      // No components
      if (!box.width) {return;}

      // Obtain the center point, and offset the canvas by the difference
      // Keep the left margin at multiples of 10 to match components
      var componentCenter = box.left + (box.width / 2);
      var newLeft = sidebarWidth + Math.max(0, canvasCenter - componentCenter);
      newLeft = newLeft - newLeft % 10;
      t.canvas.css({marginLeft: newLeft});
    }
function ( e ) { var t = this , box = t . getComponentArea ( ) , sidebarWidth = t . sidebar . width ( ) , canvasWidth = t . $el . width ( ) - sidebarWidth , canvasCenter = canvasWidth / 2 ; // No components if ( ! box . width ) { return ; } // Obtain the center point, and offset the canvas by the difference // Keep the left margin at multiples of 10 to match components var componentCenter = box . left + ( box . width / 2 ) ; var newLeft = sidebarWidth + Math . max ( 0 , canvasCenter - componentCenter ) ; newLeft = newLeft - newLeft % 10 ; t . canvas . css ( { marginLeft : newLeft } ) ; }
Center the page by adding left margin to the canvas
Center the page by adding left margin to the canvas