Navigation Menu

Skip to content

Commit

Permalink
Changed (window).width() to Math.max(screen.width,screen.height) in p…
Browse files Browse the repository at this point in the history
…lugin

Because it was reporting an incorrect size on iOS
  • Loading branch information
tyssen committed Jan 10, 2012
1 parent 383dbea commit aab2aba
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
9 changes: 9 additions & 0 deletions readme.md
Expand Up @@ -2,5 +2,14 @@

RESS (Responsive Design + Server Side Components) add-on for ExpressionEngine to detect screen resolution via javascript and then set a variable which you can then access in your templates. Useful for creating Responsive layouts that adapt to users’ screen size and can also conditionally show or hide content.

## Changelog

1.0.0
Initial public release

1.0.1 - 11 Jan 2012
In the plugin, changed (window).width() which requires jQuery to Math.max(screen.width,screen.height) because it was reporting an incorrect size on iOS.

## Credit

This is an ExpressionEngine implementation of [Simple-RESS](https://github.com/jiolasa/Simple-RESS) by Matt Stauffer.
2 changes: 1 addition & 1 deletion system/expressionengine/third_party/ress/ext.ress.php
Expand Up @@ -6,7 +6,7 @@
* @package ExpressionEngine
* @subpackage Addons
* @category Extension
* @version 1.0
* @version 1.0.0
* @author John Faulds ~ <enquiries@tyssendesign.com.au>
* @link https://github.com/tyssen/RESS-ee
* @license http://creativecommons.org/licenses/by-sa/3.0/
Expand Down
18 changes: 15 additions & 3 deletions system/expressionengine/third_party/ress/pi.ress.php
Expand Up @@ -6,15 +6,27 @@
* @package ExpressionEngine
* @subpackage Addons
* @category Plugin
* @version 1.0
* @version 1.0.1
* @author John Faulds ~ <enquiries@tyssendesign.com.au>
* @link https://github.com/tyssen/RESS-ee
* @license http://creativecommons.org/licenses/by-sa/3.0/
*/

/**
* Changelog
*
* Version 1.0.0 20120109
* --------------------
* Initial public release
*
* Version 1.0.1 20120109
* --------------------
* Changed (window).width() which requires jQuery to Math.max(screen.width,screen.height) because it was reporting an incorrect size on iOS.
*/

$plugin_info = array(
'pi_name' => 'RESS',
'pi_version' =>'1.0.0',
'pi_version' =>'1.0.1',
'pi_author' =>'John Faulds',
'pi_author_url' => 'https://github.com/tyssen/RESS-ee',
'pi_description' => 'RESS (Responsive Design + Server Side Components) plugin - detect screen resolution via javascript and then set a variable to access in your templates. Useful for creating Responsive layouts that adapt to users’ screen size. Based on https://github.com/jiolasa/Simple-RESS',
Expand All @@ -32,7 +44,7 @@ public function cookie()
{
if(!isset($_COOKIE['screensize']))
{
return "<script>document.cookie='screensize='+$(window).width()+'; path=/';location.reload(true);</script>";
return "<script>document.cookie='screensize='+Math.max(screen.width,screen.height)+'; path=/';location.reload(true);</script>";
}
}

Expand Down

0 comments on commit aab2aba

Please sign in to comment.