]> git.mxchange.org Git - friendica.git/commitdiff
use js/modal.js to show Login page in modal
authorfabrixxm <fabrix.xm@gmail.com>
Sat, 11 Jun 2016 07:58:26 +0000 (09:58 +0200)
committerfabrixxm <fabrix.xm@gmail.com>
Sat, 11 Jun 2016 07:58:26 +0000 (09:58 +0200)
view/theme/frio/js/modal.js
view/theme/frio/templates/nav.tpl
view/theme/frio/templates/nav_head.tpl

index 973847509e7371416909a436fb99ab76dbe5d566..0a881f10f6f9d5aa06a35cfd94abf508c5c032ef 100644 (file)
@@ -50,7 +50,11 @@ $(document).ready(function(){
                }
        });
 
-
+       // Navbar login
+       $("body").on("click", "#nav-login", function(e){
+               e.preventDefault();
+               Dialog.show(this.href, this.dataset.originalTitle || this.title);
+       });
 
        // Jot nav menu.
        $("body").on("click", "#jot-modal .jot-nav li a", function(e){
@@ -81,8 +85,9 @@ $(document).ready(function(){
 });
 
 // overwrite Dialog.show from main js to load the filebrowser into a bs modal
-Dialog.show = function(url) {
+Dialog.show = function(url, title="") {
        var modal = $('#modal').modal();
+       modal.find("#modal-header h4").html(title);
        modal
                .find('#modal-body')
                .load(url, function (responseText, textStatus) {
@@ -129,6 +134,7 @@ Dialog._load = function(url) {
 
        // try to fetch the hash form the url
        var match = url.match(/fbrowser\/[a-z]+\/\?mode=none(.*)/);
+       if (match===null) return; //not fbrowser
        var hash = match[1];
 
        // initialize the filebrowser
index a3f479db992b63967d3ca763ad5c90147534eb1a..a0ee0888431fa0a652ca79a345de5cc5ec7b36e7 100644 (file)
                <div class="hidden-sm hidden-xs">
                        <ul class="nav navbar-nav navbar-right">
                                <li><a href="register" data-toggle="tooltip" title="{{$register.title}}"><i class="fa fa-street-view fa-fw"></i> {{$register.desc}}</a></li>
-                               <li data-toggle="tooltip" title="{{$nav.login.3}}">
-                                       <a href="login?mode=none" 
-                                               data-remote="false" data-toggle="modal" data-target="#loginModal"
-                                               ><i class="fa fa-sign-in fa-fw"></i></a>
+                               <li>
+                                       <a href="login?mode=none" id="nav-login"
+                                               data-toggle="tooltip" title="{{$nav.login.3}}">
+                                                       <i class="fa fa-sign-in fa-fw"></i>
+                                       </a>
                                </li>
                        </ul>
                </div>
        </div>
 </nav>
 
-<div class="modal fade" id="loginModal" tabindex="-1" role="dialog" aria-labelledby="loginModalLabel" aria-hidden="true">
-  <div class="modal-dialog">
-       <div class="modal-content">
-         <div class="modal-header">
-               <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
-               <h4 class="modal-title" id="myModalLabel">{{$nav.login.3}}</h4>
-         </div>
-         <div class="modal-body">
-               ...
-         </div>
-       </div>
-  </div>
-</div>
 {{/if}}
 
 {{* The second navbar which contains nav points of the actual page - (nav points are actual handled by this theme throug js *}}
index 13842bbe8ace4da8ab18b3bdb62f0cb38e56addd..d7b50a58d0769fb63b08fcaeda5ef11583322ba9 100644 (file)
@@ -1,12 +1,6 @@
 
 <script>
 $(document).ready(function() {
-       $("#nav-search-input-field").search_autocomplete(baseurl + '/acl');
-       
-       $("#loginModal").on("show.bs.modal", function(e) {
-           var link = $(e.relatedTarget);
-               $(this).find(".modal-body").load(link.attr("href"));
-       });
-       
+       $("#nav-search-input-field").search_autocomplete(baseurl + '/acl');     
 });
 </script>