Hash toggling

This commit is contained in:
Will Marshall
2014-05-08 13:16:10 +10:00
parent 967f2827bf
commit 50f5a1c46f
6 changed files with 32 additions and 56 deletions

View File

@@ -14,7 +14,3 @@ Darkswarm.controller "HubNodeCtrl", ($scope, HashNavigation, $location, $anchorS
$scope.changeHub = ->
if confirm "Are you sure? This will change your selected Hub and remove any items in you shopping cart."
Navigation.go $scope.hub.path
if $scope.open()
$anchorScroll()

View File

@@ -13,3 +13,7 @@ window.Darkswarm = angular.module("Darkswarm", ["ngResource",
# This allows us to trigger these two events on tooltips
$tooltipProvider.setTriggers( 'openTrigger': 'closeTrigger' )
Darkswarm.run ($rootScope, $location, $anchorScroll) ->
$rootScope.$on "$locationChangeSuccess", (newRoute, oldRoute) ->
$anchorScroll()

View File

@@ -1,50 +0,0 @@
/* Off canvas layout CSS/JS provided by or adapted from work by Jason Weaver and Luke Wroblewski Requires globals.css grid.css */
body.off-canvas { padding: 0; margin: 0;}
.container { width: 100%; }
.row { overflow: hidden; }
.row .row { overflow: visible; }
.paneled .container { overflow: hidden; }
.paneled .row { width: 100%; }
[role="main"]:before { content: " "; position: absolute; z-index: -1; top: 0; left: -100%; width: 100%; height: 100%; }
[role="complementary"], [role="main"] { width: 100%; padding: 0 15px; display: block; position: relative; z-index: 1; -webkit-transition: 0.25s all ease-in; -moz-transition: 0.25s all ease-in; -o-transition: 0.25s all ease-in; transition: 0.25s all ease-in; }
.paneled [role="main"] { padding: 0; }
.page-panel { width: 100%; padding: 0 15px; -webkit-transition: 0.3s margin ease-in-out; -moz-transition: 0.3s margin ease-in-out; -o-transition: 0.3s margin ease-in-out; transition: 0.3s margin ease-in-out; background: #fff; }
#switchPanels { margin: 0 -15px; }
.hide-extras [role="complementary"] { display: block; }
[role="navigation"]#topMenu { -webkit-transition: 0.25s all ease-in; -moz-transition: 0.25s all ease-in; -o-transition: 0.25s all ease-in; transition: 0.25s all ease-in; }
[role="navigation"]#topMenu ul { margin-top: 0; }
[role="complementary"] { margin-left: -100%; width: 400px; float: left; z-index: 2; }
[role="main"] { margin-left: 0; float: right; z-index: 1; position: relative; }
.paneled [role="main"] { background: #fff; width: 500%; overflow: hidden; float: none; position: relative; left: 0; -webkit-transition: 0.15s all ease-in; -moz-transition: 0.15s all ease-in; -o-transition: 0.15s all ease-in; transition: 0.15s all ease-in; }
.page-panel { min-height: 400px; float: left; margin: 0; width: 20%; }
[role="complementary"].active { margin-left: 0; }
.active + [role="main"] { margin-right: -420px; }
.active-menu [role="navigation"]#topMenu { margin-top: 0 !important; }
@media all and (min-width: 768px) { menu-button, .sidebar-button { display: none; }
/*[role="complementary"] { width: 20%; margin-left: 0; float: left; padding: 0 15px; }*/
[role="main"] { width: 100%; padding: 0 15px; }
.paneled [role="main"] { width: 100%; padding: 0; background: #f4f4f4; left: 0 !important; }
.page-panel { display: block; min-height: 800px; float: none; margin: 0; width: 100%; background: #f4f4f4; }
.hide-extras [role="main"] { width: 100%; }
.hide-extras [role="complementary"] { display: none; }
[role="navigation"]#topMenu { display: none; } }

View File

@@ -26,7 +26,7 @@
%hub.active_table_node.row{"ng-repeat" => "hub in filteredHubs = (hubs | hubs:query)",
"ng-class" => "{'closed' : !open(), 'open' : open(), 'inactive' : !hub.active, 'current' : current()}",
"ng-controller" => "HubNodeCtrl",
id: "{{hub.path}}"}
id: "{{hub.hash}}"}
.small-12.columns
= render partial: 'home/skinny'
= render partial: 'home/fat'

View File

@@ -9,7 +9,7 @@
%span.nav-primary Hubs
- else
%li
%a{href: root_path + "#hubs"}
%a{href: root_path + "#/#hubs"}
%span.nav-primary Hubs
%li.divider
%li

View File

@@ -16,6 +16,32 @@
%li= link_to image_tag("ofn_logo_small.png"), root_path
%li
%a{href: main_app.producers_path} Producers
- if current_page? root_path
%li
%a{"ofn-scroll-to" => "hubs"}
%span.nav-primary Hubs
- else
%li
%a{href: root_path + "#/#hubs"}
%span.nav-primary Hubs
%li
%a{href: ""}
%span.nav-primary Map
%li
%a{href: main_app.producers_path}
%span.nav-primary Producers
%li
%a{href: ""}
%span.nav-primary Groups
- if spree_current_user.andand.has_spree_role? 'admin'
%li
%a{href: spree_admin_path}
%span.nav-primary Admin
%li
- if spree_current_user.nil?
= render 'shared/signed_out'