From 3babd676044531673a99ca613df62febf4596eb6 Mon Sep 17 00:00:00 2001 From: jlukic Date: Thu, 28 Aug 2014 20:00:30 -0400 Subject: [PATCH] Fix increase/decrease example in header --- server/documents/elements/header.html.eco | 22 +++---- server/files/javascript/semantic.js | 73 +++++++---------------- 2 files changed, 33 insertions(+), 62 deletions(-) diff --git a/server/documents/elements/header.html.eco b/server/documents/elements/header.html.eco index d36237e6b..8249d0d19 100755 --- a/server/documents/elements/header.html.eco +++ b/server/documents/elements/header.html.eco @@ -14,6 +14,8 @@ themes : ['Default', 'Bookish', 'Chubby'] <%- @partial('header') %> + +
@@ -65,7 +67,11 @@ themes : ['Default', 'Bookish', 'Chubby']

Page Headings

Headers may be oriented to give the heirarchy of a section in the context of the page

Page headings size themselves relative to the base font of the entire page not the surrounding text.
-
+ +

First header

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.

Second header

@@ -77,17 +83,17 @@ themes : ['Default', 'Bookish', 'Chubby']
Fifth header

Phasellus ultrices nulla quis nibh. Quisque a lectus. Donec consectetuer ligula vulputate sem tristique cursus. Nam nulla quam, gravida non, commodo a, sodales sit amet, nisi.

-

Content Headings

Headers may be oriented to give the importance of a section in the context of the content that surrounds it

Content headings size themselves relative to the base font of the surrounding text
-
+ +
Huge Header

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.

Large Header
@@ -99,10 +105,6 @@ themes : ['Default', 'Bookish', 'Chubby']
Tiny Header

Phasellus ultrices nulla quis nibh. Quisque a lectus. Donec consectetuer ligula vulputate sem tristique cursus. Nam nulla quam, gravida non, commodo a, sodales sit amet, nisi.

-

States

diff --git a/server/files/javascript/semantic.js b/server/files/javascript/semantic.js index 5b14cc368..ab16d1b93 100755 --- a/server/files/javascript/semantic.js +++ b/server/files/javascript/semantic.js @@ -45,11 +45,12 @@ semantic.ready = function() { $menuPopup = $('.ui.main.menu .popup.item'), $menuDropdown = $('.ui.main.menu .dropdown'), - $pageTabMenu = $('.tab.header.segment .tabular.menu'), - $pageTabs = $('.tab.header.segment .menu .item'), + $pageTabMenu = $('body > .tab.segment .tabular.menu'), + $pageTabs = $('body > .tab.segment .menu .item'), $downloadDropdown = $('.download.buttons .dropdown'), + $helpPopup = $('.header .help.icon'), $example = $('.example'), $shownExample = $example.filter('.shown'), @@ -59,10 +60,6 @@ semantic.ready = function() { $designer = $('.designer.item'), $sidebarButton = $('.attached.launch.button'), - - $increaseFont = $('.font .increase'), - $decreaseFont = $('.font .decrease'), - $code = $('div.code').not('.existing'), $existingCode = $('.existing.code'), @@ -145,15 +142,15 @@ semantic.ready = function() { url : variableURL, dataType : 'text', urlData : urlData, - onSuccess: function(content) { - window.less.modifyVars( handler.less.parseFile(content) ); + success: function(content) { + less.modifyVars( handler.less.parseFile(content) ); $themeDropdown .api({ on : 'now', url : overrideURL, dataType : 'text', urlData : urlData, - onSuccess: function(content) { + success: function(content) { if( $('style.override').size() > 0 ) { $('style.override').remove(); } @@ -236,28 +233,6 @@ semantic.ready = function() { return $element; } }, - - font: { - - increase: function() { - var - $container = $(this).parent().prev('.ui.segment'), - fontSize = parseInt( $container.css('font-size'), 10) - ; - $container - .css('font-size', fontSize + 1) - ; - }, - decrease: function() { - var - $container = $(this).parent().prev('.ui.segment'), - fontSize = parseInt( $container.css('font-size'), 10) - ; - $container - .css('font-size', fontSize - 1) - ; - } - }, overviewMode: function() { var $button = $(this), @@ -710,22 +685,8 @@ semantic.ready = function() { } }; - - $sidebarButton - .on('mouseenter', handler.menu.mouseenter) - .on('mouseleave', handler.menu.mouseleave) - ; - $menu - .sidebar({ - animation : 'scale down' - }) - .sidebar('attach events', '.launch.button, .view-ui.button, .launch.item') - .sidebar('attach events', $hideMenu, 'hide') - ; - $('.masthead') .visibility({ - context: '.pusher > .page', once: false }) .visibility('bottom visible', function(){ @@ -800,15 +761,12 @@ semantic.ready = function() { .each(handler.createCode) ; - $swap - .on('click', handler.swapStyle) + $helpPopup + .popup() ; - $increaseFont - .on('click', handler.font.increase) - ; - $decreaseFont - .on('click', handler.font.decrease) + $swap + .on('click', handler.swapStyle) ; $developer @@ -840,6 +798,17 @@ semantic.ready = function() { }) ; + $sidebarButton + .on('mouseenter', handler.menu.mouseenter) + .on('mouseleave', handler.menu.mouseleave) + ; + $menu + .sidebar({ + animation: 'scale down' + }) + .sidebar('attach events', '.launch.button, .view-ui.button, .launch.item') + .sidebar('attach events', $hideMenu, 'hide') + ; $waypoints .waypoint({ continuous : false,