From dc46aafb93267662202c1f59a59936c95a4fada0 Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Mon, 22 Aug 2016 12:07:01 -0400 Subject: [PATCH] Added top-offset for member detail package zoom Added a top-offset option for adding extra space if you zoom to a package on member detail pages, after clicking the packages link, just in case of a sticky header (like on this site). The value can be set in management, like the floating search distance from top. --- classes/data/settings/dataSettingsGeneral.php | 12 ++++++++++-- index.php | 2 +- ...abase_V1.1.15.sql => create_database_V1.1.16.sql} | 5 +++-- setup/databaseScripts/dbVersions.php | 3 ++- ...atabase_V1.1.15.sql => drop_database_V1.1.16.sql} | 2 +- setup/databaseScripts/update_database_V1.1.16.sql | 9 +++++++++ views/admin/management/index.html | 1 + views/front/members/detail.html | 3 ++- views/front/members/list.html | 5 ++--- 9 files changed, 31 insertions(+), 11 deletions(-) rename setup/databaseScripts/{create_database_V1.1.15.sql => create_database_V1.1.16.sql} (98%) rename setup/databaseScripts/{drop_database_V1.1.15.sql => drop_database_V1.1.16.sql} (95%) create mode 100644 setup/databaseScripts/update_database_V1.1.16.sql diff --git a/classes/data/settings/dataSettingsGeneral.php b/classes/data/settings/dataSettingsGeneral.php index e204f247..46516141 100644 --- a/classes/data/settings/dataSettingsGeneral.php +++ b/classes/data/settings/dataSettingsGeneral.php @@ -270,7 +270,7 @@ class GlmDataSettingsGeneral extends GlmDataAbstract 'use' => 'a' ), - // Front-end Listings - Show Search Alpha + // Front-end Listings - Whether the Search/Filters box should be sticky 'list_floating_search' => array( 'field' => 'list_floating_search', 'type' => 'checkbox', @@ -278,7 +278,7 @@ class GlmDataSettingsGeneral extends GlmDataAbstract 'use' => 'a' ), - // Front-end Listings - Show Search Alpha + // Front-end Listings - How far from the top the sticky Search/Filters box should hover 'list_floating_search_distance_top' => array( 'field' => 'list_floating_search_distance_top', 'type' => 'integer', @@ -625,6 +625,14 @@ class GlmDataSettingsGeneral extends GlmDataAbstract 'use' => 'a' ), + // Front-end Listings - How far from the top the sticky Search/Filters box should hover + 'detail_top_offset_autoscroll' => array( + 'field' => 'detail_top_offset_autoscroll', + 'type' => 'integer', + 'default' => 0, + 'use' => 'a' + ), + // Front-end Member Detail - Show Directions 'detail_show_directions' => array( 'field' => 'detail_show_directions', diff --git a/index.php b/index.php index 4c750bcc..e7be8268 100644 --- a/index.php +++ b/index.php @@ -39,7 +39,7 @@ */ define('GLM_MEMBERS_PLUGIN_VERSION', '2.5.0'); -define('GLM_MEMBERS_PLUGIN_DB_VERSION', '1.1.15'); +define('GLM_MEMBERS_PLUGIN_DB_VERSION', '1.1.16'); // Check if plugin version is not current in WordPress option and if needed updated it if (GLM_MEMBERS_PLUGIN_VERSION != get_option('glmMembersDatabasePluginVersion')) { diff --git a/setup/databaseScripts/create_database_V1.1.15.sql b/setup/databaseScripts/create_database_V1.1.16.sql similarity index 98% rename from setup/databaseScripts/create_database_V1.1.15.sql rename to setup/databaseScripts/create_database_V1.1.16.sql index ac72c2a7..69c3d864 100644 --- a/setup/databaseScripts/create_database_V1.1.15.sql +++ b/setup/databaseScripts/create_database_V1.1.16.sql @@ -1,6 +1,6 @@ -- Gaslight Media Members Database -- File Created: 12/09/14 15:27:15 --- Database Version: 1.1.15 +-- Database Version: 1.1.16 -- Database Creation Script -- -- To permit each query below to be executed separately, @@ -272,7 +272,7 @@ CREATE TABLE {prefix}settings_general ( list_show_search_amenities BOOLEAN DEFAULT '1', list_show_search_alpha BOOLEAN DEFAULT '1', list_floating_search BOOLEAN DEFAULT '0', - list_floating_search_distance_top INTEGER DEFAULT '0', + list_floating_search_distance_top INTEGER DEFAULT '0', -- How far from the top the sticky Search/Filters box should hover list_show_detail_link BOOLEAN DEFAULT '1', list_show_logo BOOLEAN DEFAULT '1', list_logo_size TINYTEXT NULL, @@ -338,6 +338,7 @@ CREATE TABLE {prefix}settings_general ( detail_show_packages BOOLEAN DEFAULT '0', detail_show_events BOOLEAN DEFAULT '0', detail_show_video BOOLEAN DEFAULT '0', + detail_top_offset_autoscroll INTEGER DEFAULT '0', -- Determines the distance from the top when autoscrolling to a section on member detail pages detail_map_show_logo BOOLEAN DEFAULT '0', detail_map_logo_size TINYTEXT NULL, detail_map_show_descr BOOLEAN DEFAULT '0', diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php index eaff8f5f..4bc788f6 100644 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -46,7 +46,8 @@ $glmMembersDbVersions = array( '1.1.12' => array('version' => '1.1.12', 'tables' => 16, 'date' => '8/2/16'), '1.1.13' => array('version' => '1.1.13', 'tables' => 18, 'date' => '8/4/16'), '1.1.14' => array('version' => '1.1.14', 'tables' => 18, 'date' => '8/15/16'), - '1.1.15' => array('version' => '1.1.15', 'tables' => 18, 'date' => '8/19/16') + '1.1.15' => array('version' => '1.1.15', 'tables' => 18, 'date' => '8/19/16'), + '1.1.16' => array('version' => '1.1.16', 'tables' => 18, 'date' => '8/22/16') ); diff --git a/setup/databaseScripts/drop_database_V1.1.15.sql b/setup/databaseScripts/drop_database_V1.1.16.sql similarity index 95% rename from setup/databaseScripts/drop_database_V1.1.15.sql rename to setup/databaseScripts/drop_database_V1.1.16.sql index b004ba03..935890b5 100644 --- a/setup/databaseScripts/drop_database_V1.1.15.sql +++ b/setup/databaseScripts/drop_database_V1.1.16.sql @@ -1,6 +1,6 @@ -- Gaslight Media Members Database -- File Created: 12/09/14 15:27:15 --- Database Version: 1.1.15 +-- Database Version: 1.1.16 -- Database Deletion Script -- Note: Tables with DELETE CASCADE must appear before referenced table diff --git a/setup/databaseScripts/update_database_V1.1.16.sql b/setup/databaseScripts/update_database_V1.1.16.sql new file mode 100644 index 00000000..c160257b --- /dev/null +++ b/setup/databaseScripts/update_database_V1.1.16.sql @@ -0,0 +1,9 @@ +-- Gaslight Media Members Database +-- File Created: 8/15/16 14:59:42 +-- Database Version: 1.1.16 +-- Database Update From Previous Version Script +-- +-- To permit each query below to be executed separately, +-- all queries must be separated by a line with four dashes +-- Determines the distance from the top when autoscrolling to a section on member detail pages +ALTER TABLE {prefix}settings_general ADD COLUMN detail_top_offset_autoscroll INTEGER NULL DEFAULT '0'; \ No newline at end of file diff --git a/views/admin/management/index.html b/views/admin/management/index.html index a3d18d73..a97b5fa0 100644 --- a/views/admin/management/index.html +++ b/views/admin/management/index.html @@ -302,6 +302,7 @@ Show Packages: Show Events: Show Video: + Autoscroll Offset From Top (height of sticky nav):px diff --git a/views/front/members/detail.html b/views/front/members/detail.html index 9601027b..d9e92399 100644 --- a/views/front/members/detail.html +++ b/views/front/members/detail.html @@ -379,10 +379,11 @@ $("#"+target+"-toggle").addClass("selected"); fullProfileCheck(target); $('html, body').animate({ - scrollTop: $("#"+target+"-toggle").offset().top + scrollTop: $("#"+target+"-toggle").offset().top-{$settings.detail_top_offset_autoscroll} }, 500); }); + // Open or close the appropriate section if a toggle is clicked $(".glm-member-detail-content-toggle").not("#glm-member-detail-fullprofile-toggle").click(function() { if($(this).parents('.glm-member-detail-sub-data-links').length) { diff --git a/views/front/members/list.html b/views/front/members/list.html index c2d3c502..30fb714d 100644 --- a/views/front/members/list.html +++ b/views/front/members/list.html @@ -426,7 +426,6 @@ $(window).scroll(function() { var currentScroll = $(window).scrollTop(); - //console.log("{$settings.list_floating_search_distance_top}"); if (currentScroll >= fixmeTop-{$settings.list_floating_search_distance_top} && {$settings.list_floating_search}) { $('#glm-member-list-filters-wrapper').css({ position: 'fixed', @@ -441,7 +440,7 @@ }); } - }); + }); $(".glm-member-list-filters-toggle").click( function() { $(".glm-member-db-{$view}-view").toggleClass("filters-opened"); $(".glm-member-db-{$view}-view").toggleClass("filters-closed"); @@ -450,8 +449,8 @@ var center = map.getCenter(); google.maps.event.trigger(map, "resize"); map.setCenter(center); + }); }); - }); {/if} // settings.list_show_search {if $settings.list_show_map} -- 2.17.1