<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Turn off/hide print button just for mobile devices in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/turn-off-hide-print-button-just-for-mobile-devices/m-p/336957#M31151</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tracy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Media queries will work but like you point out there are issue with that approach. The Approach I like to use is feature detection for touch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Most &lt;/STRONG&gt;touch devices do not have print capability but as with most routes this can exclude some devices that have some printing ability. So there are pros and cons.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a good link for touch feature detection:&lt;/P&gt;&lt;P&gt;&lt;A href="http://stackoverflow.com/questions/4817029/whats-the-best-way-to-detect-a-touch-screen-device-using-javascript#answer-4819886" title="http://stackoverflow.com/questions/4817029/whats-the-best-way-to-detect-a-touch-screen-device-using-javascript#answer-4819886" rel="nofollow noopener noreferrer" target="_blank"&gt;jquery - What's the best way to detect a 'touch screen' device using JavaScript? - Stack Overflow&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the latest Modernixr test for touch:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var bool;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (('ontouchstart' in window) || window.DocumentTouch &amp;amp;&amp;amp; document instanceof DocumentTouch) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bool = true;
&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var query = ['@media (', prefixes.join('touch-enabled),('), 'heartz', ')', '{#modernizr{top:9px;position:absolute}}'].join('');
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; testStyles(query, function(node) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bool = node.offsetTop === 9;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Most of all do not let anyone convince you to use any sort of user agent detection. User agent detection is NOT the way to go.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 15:57:31 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2021-12-11T15:57:31Z</dc:date>
    <item>
      <title>Turn off/hide print button just for mobile devices</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/turn-off-hide-print-button-just-for-mobile-devices/m-p/336956#M31150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a print button on my map that I would like to hide if the user is accessing the map from a mobile device.&amp;nbsp; I have a media query set up&lt;/P&gt;&lt;P&gt;@media (max-width:767px) {&lt;/P&gt;&lt;P&gt;#btnPrint {&lt;/P&gt;&lt;P&gt;visibility:hidden&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;but the problem is the wide range of resolutions available on mobile devices.&amp;nbsp; I could easily have a user hitting the site with a desktop, where I do want them to have a print button.&amp;nbsp; It seems like a media query isn't going to cover all the bases.&amp;nbsp; It seems to be OK for a typical phone, but not for something like a tablet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there another (or better) way to handle this?&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 21:02:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/turn-off-hide-print-button-just-for-mobile-devices/m-p/336956#M31150</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2015-06-10T21:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: Turn off/hide print button just for mobile devices</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/turn-off-hide-print-button-just-for-mobile-devices/m-p/336957#M31151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tracy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Media queries will work but like you point out there are issue with that approach. The Approach I like to use is feature detection for touch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Most &lt;/STRONG&gt;touch devices do not have print capability but as with most routes this can exclude some devices that have some printing ability. So there are pros and cons.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a good link for touch feature detection:&lt;/P&gt;&lt;P&gt;&lt;A href="http://stackoverflow.com/questions/4817029/whats-the-best-way-to-detect-a-touch-screen-device-using-javascript#answer-4819886" title="http://stackoverflow.com/questions/4817029/whats-the-best-way-to-detect-a-touch-screen-device-using-javascript#answer-4819886" rel="nofollow noopener noreferrer" target="_blank"&gt;jquery - What's the best way to detect a 'touch screen' device using JavaScript? - Stack Overflow&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the latest Modernixr test for touch:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var bool;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (('ontouchstart' in window) || window.DocumentTouch &amp;amp;&amp;amp; document instanceof DocumentTouch) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bool = true;
&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var query = ['@media (', prefixes.join('touch-enabled),('), 'heartz', ')', '{#modernizr{top:9px;position:absolute}}'].join('');
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; testStyles(query, function(node) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bool = node.offsetTop === 9;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Most of all do not let anyone convince you to use any sort of user agent detection. User agent detection is NOT the way to go.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:57:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/turn-off-hide-print-button-just-for-mobile-devices/m-p/336957#M31151</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T15:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: Turn off/hide print button just for mobile devices</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/turn-off-hide-print-button-just-for-mobile-devices/m-p/336958#M31152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in dojo, you could use &lt;STRONG&gt;has('touch')&lt;/STRONG&gt; to detect touch capability&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 21:25:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/turn-off-hide-print-button-just-for-mobile-devices/m-p/336958#M31152</guid>
      <dc:creator>thejuskambi</dc:creator>
      <dc:date>2015-06-10T21:25:11Z</dc:date>
    </item>
  </channel>
</rss>

