Replace swap method with change in viewports.js