Prevent annoying scrolling in EntryEdit page

Project: http://git-wip-us.apache.org/repos/asf/roller/repo
Commit: http://git-wip-us.apache.org/repos/asf/roller/commit/a3763486
Tree: http://git-wip-us.apache.org/repos/asf/roller/tree/a3763486
Diff: http://git-wip-us.apache.org/repos/asf/roller/diff/a3763486

Branch: refs/heads/bootstrap-ui
Commit: a3763486e7bf77e45f37dd8b3c2367967f58401c
Parents: 8042fd7
Author: Kohei Nozaki <[email protected]>
Authored: Wed Jan 6 13:56:16 2016 +0900
Committer: Kohei Nozaki <[email protected]>
Committed: Wed Jan 6 13:56:16 2016 +0900

----------------------------------------------------------------------
 app/src/main/webapp/WEB-INF/jsps/editor/EntryEdit.jsp   | 11 ++++++++++-
 app/src/main/webapp/WEB-INF/jsps/editor/EntryEditor.jsp |  4 ++--
 2 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/roller/blob/a3763486/app/src/main/webapp/WEB-INF/jsps/editor/EntryEdit.jsp
----------------------------------------------------------------------
diff --git a/app/src/main/webapp/WEB-INF/jsps/editor/EntryEdit.jsp 
b/app/src/main/webapp/WEB-INF/jsps/editor/EntryEdit.jsp
index b5ba20b..2fe9df7 100644
--- a/app/src/main/webapp/WEB-INF/jsps/editor/EntryEdit.jsp
+++ b/app/src/main/webapp/WEB-INF/jsps/editor/EntryEdit.jsp
@@ -22,6 +22,15 @@
 <script src="<s:url value="/roller-ui/scripts/jquery-2.1.1.min.js" 
/>"></script>
 <script src='<s:url 
value="/roller-ui/jquery-ui-1.11.0/jquery-ui.min.js"/>'></script>
 
+<%-- Prevent annoying scrolling. taken from 
http://stackoverflow.com/a/10548809/3591946 --%>
+<script type="text/javascript">
+    $().ready(function () {
+        $("a[href='#'][data-toggle='collapse']").click(function (e) {
+            e.preventDefault();
+        });
+    });
+</script>
+
 <style>
     #tagAutoCompleteWrapper {
         width: 40em; /* set width here or else widget will expand to fit its 
container */
@@ -159,7 +168,7 @@
 
                     <h4 class="panel-title">
                         <a class="collapsed" data-toggle="collapse" 
data-target="#collapsePlugins" 
-                            href="#collapsePlugins">
+                            href="#">
                             <s:text name="weblogEdit.pluginsToApply"/> </a>
                     </h4>
 

http://git-wip-us.apache.org/repos/asf/roller/blob/a3763486/app/src/main/webapp/WEB-INF/jsps/editor/EntryEditor.jsp
----------------------------------------------------------------------
diff --git a/app/src/main/webapp/WEB-INF/jsps/editor/EntryEditor.jsp 
b/app/src/main/webapp/WEB-INF/jsps/editor/EntryEditor.jsp
index 110b07f..9b59786 100644
--- a/app/src/main/webapp/WEB-INF/jsps/editor/EntryEditor.jsp
+++ b/app/src/main/webapp/WEB-INF/jsps/editor/EntryEditor.jsp
@@ -26,7 +26,7 @@
     <div class="panel-heading">
 
         <h4 class="panel-title">
-        <a data-toggle="collapse" data-target="#collapseContentEditor" 
href="#collapseContentEditor">
+        <a data-toggle="collapse" data-target="#collapseContentEditor" 
href="#">
             <s:text name="weblogEdit.content"/> </a>
         </h4>
         
@@ -52,7 +52,7 @@
     <div class="panel-heading">
 
         <h4 class="panel-title">
-            <a href="#collapseSummaryEditor" class="collapsed"
+            <a href="#" class="collapsed"
                data-toggle="collapse" data-target="#collapseSummaryEditor" >
                <s:text name="weblogEdit.summary"/>
             </a>

Reply via email to