diff --git a/desktop/analytics/article_impressions.js b/desktop/analytics/article_impressions.js index 498455fdf2d..4fca3fa1946 100644 --- a/desktop/analytics/article_impressions.js +++ b/desktop/analytics/article_impressions.js @@ -1,3 +1,6 @@ +const $ = require('jquery') +const _ = require('underscore') + if (location.pathname.match('/article/') || location.pathname.match('/articles')) { var trackedImpressions = [] @@ -123,7 +126,7 @@ if (location.pathname.match('/article/') || location.pathname.match('/articles') id: 'article_callout:' + articleId + ':' + destinationPath } } else { - return + } }).toArray() diff --git a/desktop/apps/auction/components/DOM.js b/desktop/apps/auction/components/DOM.js index 1b4cbf3c3c0..eacb2c348d4 100644 --- a/desktop/apps/auction/components/DOM.js +++ b/desktop/apps/auction/components/DOM.js @@ -4,7 +4,6 @@ import mediator from 'desktop/lib/mediator.coffee' import scrollToTop from 'desktop/apps/auction/utils/scrollToTop' import { Component } from 'react' import { connect } from 'react-redux' -import { data as sd } from 'sharify' class DOM extends Component { static propTypes = { @@ -22,7 +21,7 @@ class DOM extends Component { const FastClick = require('fastclick') // removes 300ms delay - if (sd.NODE_ENV === 'test') { + if (FastClick.attach) { FastClick.attach(document.body) } diff --git a/desktop/apps/auctions2/components/DOM.js b/desktop/apps/auctions2/components/DOM.js index a8510d0dac9..3b87b4d990e 100644 --- a/desktop/apps/auctions2/components/DOM.js +++ b/desktop/apps/auctions2/components/DOM.js @@ -1,7 +1,6 @@ import PropTypes from 'prop-types' import { Component } from 'react' import { connect } from 'react-redux' -import { data as sd } from 'sharify' class DOM extends Component { static propTypes = { @@ -16,7 +15,7 @@ class DOM extends Component { const FastClick = require('fastclick') // removes 300ms delay - if (sd.NODE_ENV === 'test') { + if (FastClick.attach) { FastClick.attach(document.body) } diff --git a/desktop/apps/inquiry/client/routes/inquiry.coffee b/desktop/apps/inquiry/client/routes/inquiry.coffee index a7fc7daa3c6..c646cf13d43 100644 --- a/desktop/apps/inquiry/client/routes/inquiry.coffee +++ b/desktop/apps/inquiry/client/routes/inquiry.coffee @@ -1,5 +1,4 @@ _ = require 'underscore' -attachFastClick = -> require('fastclick') arguments... { ARTWORK } = require('sharify').data User = require '../../../../models/user.coffee' Artwork = require '../../../../models/artwork.coffee' @@ -10,10 +9,13 @@ openErrorFlash = require '../../../../components/inquiry_questionnaire/error.cof Logger = require '../../../../components/logger/index.coffee' Trail = require '../../../../components/inquiry_questionnaire/trail.coffee' analytics = require '../../../../components/inquiry_questionnaire/analytics.coffee' +FastClick = require 'fastclick' { steps, decisions, views } = require '../map.coffee' + module.exports = (id, bypass) -> - attachFastClick document.body + if FastClick.attach + FastClick.attach document.body steps = [bypass] if bypass and _.contains(_.keys(views), bypass) diff --git a/desktop/apps/inquiry/stylesheets/index.styl b/desktop/apps/inquiry/stylesheets/index.styl index 59b21d1e21e..a72896f043c 100644 --- a/desktop/apps/inquiry/stylesheets/index.styl +++ b/desktop/apps/inquiry/stylesheets/index.styl @@ -4,6 +4,8 @@ .inquiry-page margin (main-header-height + 20px) 0 + +respond-mobile() + padding 20px .iqm-alert position absolute diff --git a/desktop/apps/inquiry/test/client/index.coffee b/desktop/apps/inquiry/test/client/index.coffee index f901f71f662..f63f62fbb6d 100644 --- a/desktop/apps/inquiry/test/client/index.coffee +++ b/desktop/apps/inquiry/test/client/index.coffee @@ -12,7 +12,7 @@ describe 'mobile inquiry flow initialization', -> jQuery: benv.require 'jquery' Backbone.$ = $ initializeInquiry = rewire '../../client/routes/inquiry' - initializeInquiry.__set__ 'attachFastClick', sinon.stub() + initializeInquiry.__set__ 'FastClick', sinon.stub() @StateView = initializeInquiry.__get__ 'StateView' @render = sinon.stub @StateView::, 'render', -> this done() diff --git a/desktop/components/recently_viewed_artworks/index.styl b/desktop/components/recently_viewed_artworks/index.styl index b175b92b3d7..756aa1e8847 100644 --- a/desktop/components/recently_viewed_artworks/index.styl +++ b/desktop/components/recently_viewed_artworks/index.styl @@ -3,6 +3,8 @@ #recently-viewed-artworks background-color gray-lightest-color + +respond-mobile() + padding 17px .rva-container padding-bottom 50px .rva-header diff --git a/desktop/components/simple_contact/stylesheets/index.styl b/desktop/components/simple_contact/stylesheets/index.styl index 49bd754c5eb..f51f14f7043 100644 --- a/desktop/components/simple_contact/stylesheets/index.styl +++ b/desktop/components/simple_contact/stylesheets/index.styl @@ -12,7 +12,9 @@ text-align center border-bottom 1px solid gray-lighter-color padding 0 0 20px - margin 0 -30px + +respond-desktop() + margin 0 -30px + .scontact-errors .scontact-description .scontact-from diff --git a/mobile/assets/mobile_all.coffee b/mobile/assets/mobile_all.coffee index 7fc2661664f..7cb22953e8a 100644 --- a/mobile/assets/mobile_all.coffee +++ b/mobile/assets/mobile_all.coffee @@ -6,7 +6,7 @@ # to get more complex in how we break up and load assets. # -require 'jquery' +$ = require 'jquery' sd = require('sharify').data # TODO: Refactor to use Backbone router diff --git a/mobile/assets/mobile_articles.coffee b/mobile/assets/mobile_articles.coffee index 30a7845681a..42ae597a09e 100644 --- a/mobile/assets/mobile_articles.coffee +++ b/mobile/assets/mobile_articles.coffee @@ -1,5 +1,6 @@ -require 'jquery' +$ = require 'jquery' require('backbone').$ = $ +sd = require('sharify').data articleIndex = require '../apps/articles/client/articles.coffee' sectionView = require '../apps/articles/client/section.coffee' ArticleView = require '../components/article/client/view.coffee' diff --git a/mobile/components/layout/bootstrap.coffee b/mobile/components/layout/bootstrap.coffee index fae3e7e645d..96f47dcc597 100644 --- a/mobile/components/layout/bootstrap.coffee +++ b/mobile/components/layout/bootstrap.coffee @@ -5,9 +5,10 @@ # included across most apps and any uncessary bloat should be avoided. # -require 'jquery' +$ = require 'jquery' Backbone = require 'backbone' Backbone.$ = $ + _ = require 'underscore' FastClick = require 'fastclick' RavenClient = require 'raven-js' @@ -18,6 +19,12 @@ HeaderView = require './client/header_view.coffee' doc = window.document sharify = require('sharify') +imagesLoaded = require 'imagesloaded' +imagesLoaded.makeJQueryPlugin($) + +jqueryFillwidthLite = require 'jquery-fillwidth-lite' +jqueryFillwidthLite($, _, imagesLoaded) + module.exports = -> # Add the Gravity XAPP or access token to all ajax requests $.ajaxSettings.headers = { @@ -32,7 +39,7 @@ module.exports = -> Cookies.set 'inquiry-session-start', location.href # removes 300ms delay - if sharify.data.NODE_ENV is 'development' + if FastClick.attach FastClick.attach document.body setupErrorReporting()