From 733b249b12ecc45d64f4552aed98894d5e22cabe Mon Sep 17 00:00:00 2001 From: summerscope Date: Thu, 30 Oct 2014 17:01:42 +1100 Subject: [PATCH] making tabs break down better for responsive and small devices --- app/views/shopping_shared/_tabs.html.haml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/views/shopping_shared/_tabs.html.haml b/app/views/shopping_shared/_tabs.html.haml index c19ec56755..d136efa045 100644 --- a/app/views/shopping_shared/_tabs.html.haml +++ b/app/views/shopping_shared/_tabs.html.haml @@ -1,14 +1,16 @@ #tabs{"ng-controller" => "TabsCtrl"} .row - %tabset.small-12.columns + %tabset -# Build all tabs. - - for name, heading in { about: "About #{current_distributor.name}", - producers: "Producers", - groups: "Groups", - contact: "Contact"} + - for name, heading_cols in { about: ["About #{current_distributor.name}", 4], + producers: ["Producers",3], + groups: ["Groups",2], + contact: ["Contact",3]} -# tabs take tab path in 'active' and 'select' functions defined in TabsCtrl. - %tab{heading: heading, + - heading, cols = heading_cols + %tab.columns{heading: heading, id: "tab_#{name}", active: "active(\'#{name}\')", - select: "select(\'#{name}\')"} + select: "select(\'#{name}\')", + class: "small-12 medium-#{cols}" } = render "shopping_shared/#{name}"