summaryrefslogtreecommitdiff
path: root/web-ui
diff options
context:
space:
mode:
authorGabriel Albo <gabriel@albo.com.br>2014-08-21 10:33:22 -0300
committerGabriel Albo <gabriel@albo.com.br>2014-08-21 10:33:31 -0300
commitd63d4b489af735651cee9d50357aa84106a19cd2 (patch)
tree9003f48df2a5b86eda583484794863058427327b /web-ui
parentdc95cd401a814d19fcbb588f76ffdcc10aa4ec61 (diff)
Moving smooth transition js funtion to a specific style-guide js file
Diffstat (limited to 'web-ui')
-rw-r--r--web-ui/app/js/style_guide/main.js16
-rw-r--r--web-ui/app/style-guide.html23
2 files changed, 19 insertions, 20 deletions
diff --git a/web-ui/app/js/style_guide/main.js b/web-ui/app/js/style_guide/main.js
new file mode 100644
index 00000000..d9092641
--- /dev/null
+++ b/web-ui/app/js/style_guide/main.js
@@ -0,0 +1,16 @@
+$(document).ready(function(){
+ $('a[href*=#]').click(function() {
+ if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
+ && location.hostname == this.hostname) {
+ var $target = $(this.hash);
+ $target = $target.length && $target
+ || $('[name=' + this.hash.slice(1) +']');
+ if ($target.length) {
+ var targetOffset = $target.offset().top;
+ $('html,body')
+ .animate({scrollTop: targetOffset}, 500);
+ return false;
+ }
+ }
+ });
+}); \ No newline at end of file
diff --git a/web-ui/app/style-guide.html b/web-ui/app/style-guide.html
index d24f0bda..ee6b89fd 100644
--- a/web-ui/app/style-guide.html
+++ b/web-ui/app/style-guide.html
@@ -12,26 +12,6 @@
<link href="css/style-guide.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" href="../css/main.css">
</head>
-<script src="/bower_components/jquery/dist/jquery.js"></script>
-<script type="text/javascript">
- $(document).ready(function(){
- $('a[href*=#]').click(function() {
- if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
- && location.hostname == this.hostname) {
- var $target = $(this.hash);
- $target = $target.length && $target
- || $('[name=' + this.hash.slice(1) +']');
- if ($target.length) {
- var targetOffset = $target.offset().top;
- $('html,body')
- .animate({scrollTop: targetOffset}, 500);
- return false;
- }
- }
- });
- });
-</script>
-
<body>
<div id="style-guide-wrap" data-offcanvas>
<nav class="top-bar" data-topbar>
@@ -192,5 +172,8 @@
</br>
</section>
</div>
+
+<script src="/bower_components/jquery/dist/jquery.js"></script>
+<script src="/js/style_guide/main.js"></script>
</body>
</html>