Shortcodes by Angie Makes - Version 1.75

Version Description

Download this release

Release Info

Developer cbaldelomar
Plugin Icon wp plugin Shortcodes by Angie Makes
Version 1.75
Comparing to
See all releases

Code changes from version 1.74 to 1.75

Files changed (4) hide show
  1. README.md +4 -0
  2. includes/js/posts.js +14 -20
  3. readme.txt +4 -0
  4. wc-shortcodes.php +2 -2
README.md CHANGED
@@ -66,6 +66,10 @@ Use the shortcode manager in the TinyMCE text editor
66
 
67
  ## Changelog ##
68
 
 
 
 
 
69
  ### Version 1.74
70
 
71
  * Fixed style bug with wc_posts category links
66
 
67
  ## Changelog ##
68
 
69
+ ### Version 1.75
70
+
71
+ * Improved logic for calculating colums of masonry grid for mobile and tablet devices.
72
+
73
  ### Version 1.74
74
 
75
  * Fixed style bug with wc_posts category links
includes/js/posts.js CHANGED
@@ -24,6 +24,7 @@
24
  var gutterWidth = $container.data('gutterSpace');
25
  // need to return exact decimal width
26
  var containerWidth = Math.floor($container[0].getBoundingClientRect().width);
 
27
 
28
  if ( isNaN( gutterWidth ) ) {
29
  gutterWidth = 20;
@@ -32,26 +33,6 @@
32
  gutterWidth = 20;
33
  }
34
 
35
- if ( containerWidth < 568 ) {
36
- columns = 1;
37
- }
38
- else if ( containerWidth < 768 ) {
39
- columns -= 2;
40
- if ( columns < 2 ) {
41
- columns = 2;
42
- }
43
- }
44
- else if ( containerWidth < 991 ) {
45
- columns -= 1;
46
- if ( columns < 2 ) {
47
- columns = 2;
48
- }
49
- }
50
-
51
- if ( columns < 1 ) {
52
- columns = 1;
53
- }
54
-
55
  gutterWidth = parseInt( gutterWidth );
56
 
57
  var allGutters = gutterWidth * ( columns - 1 );
@@ -59,6 +40,19 @@
59
 
60
  var columnWidth = Math.floor( contentWidth / columns );
61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  return {columnWidth: columnWidth, gutterWidth: gutterWidth, columns: columns};
63
  }
64
 
24
  var gutterWidth = $container.data('gutterSpace');
25
  // need to return exact decimal width
26
  var containerWidth = Math.floor($container[0].getBoundingClientRect().width);
27
+ var minColumnWidth = 200;
28
 
29
  if ( isNaN( gutterWidth ) ) {
30
  gutterWidth = 20;
33
  gutterWidth = 20;
34
  }
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  gutterWidth = parseInt( gutterWidth );
37
 
38
  var allGutters = gutterWidth * ( columns - 1 );
40
 
41
  var columnWidth = Math.floor( contentWidth / columns );
42
 
43
+ if ( columnWidth < minColumnWidth ) {
44
+ columns = Math.floor( contentWidth / minColumnWidth );
45
+
46
+ if ( columns < 1 ) {
47
+ columns = 1;
48
+ }
49
+
50
+ allGutters = gutterWidth * ( columns - 1 );
51
+ contentWidth = containerWidth - allGutters;
52
+
53
+ columnWidth = Math.floor( contentWidth / columns );
54
+ }
55
+
56
  return {columnWidth: columnWidth, gutterWidth: gutterWidth, columns: columns};
57
  }
58
 
readme.txt CHANGED
@@ -88,6 +88,10 @@ Use the shortcode manager in the TinyMCE text editor
88
 
89
  == Changelog ==
90
 
 
 
 
 
91
  = Version 1.74 =
92
 
93
  * Fixed style bug with wc_posts category links
88
 
89
  == Changelog ==
90
 
91
+ = Version 1.75 =
92
+
93
+ * Improved logic for calculating colums of masonry grid for mobile and tablet devices.
94
+
95
  = Version 1.74 =
96
 
97
  * Fixed style bug with wc_posts category links
wc-shortcodes.php CHANGED
@@ -5,11 +5,11 @@ Plugin URI: http://webplantmedia.com/starter-themes/wordpresscanvas/features/sho
5
  Description: A family of shortcodes to enhance site functionality.
6
  Author: Chris Baldelomar
7
  Author URI: http://webplantmedia.com/
8
- Version: 1.74
9
  License: GPLv2 or later
10
  */
11
 
12
- define( 'WC_SHORTCODES_VERSION', '1.74' );
13
  define( 'WC_SHORTCODES_PREFIX', 'wc_shortcodes_' );
14
  define( '_WC_SHORTCODES_PREFIX', '_wc_shortcodes_' );
15
  define( 'WC_SHORTCODES_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
5
  Description: A family of shortcodes to enhance site functionality.
6
  Author: Chris Baldelomar
7
  Author URI: http://webplantmedia.com/
8
+ Version: 1.75
9
  License: GPLv2 or later
10
  */
11
 
12
+ define( 'WC_SHORTCODES_VERSION', '1.75' );
13
  define( 'WC_SHORTCODES_PREFIX', 'wc_shortcodes_' );
14
  define( '_WC_SHORTCODES_PREFIX', '_wc_shortcodes_' );
15
  define( 'WC_SHORTCODES_PLUGIN_URL', plugin_dir_url( __FILE__ ) );