mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 14:46:56 +02:00
Javascript behaviour for draggable dashboard panels.
This commit is contained in:
@@ -261,7 +261,7 @@ $ADMIN_HEADER_DASHBOARD = $ADMIN_HEADER = $ADMIN_MODAL . '
|
|||||||
$ADMIN_HEADER_DASHBOARD .= '
|
$ADMIN_HEADER_DASHBOARD .= '
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12 draggable-panels">
|
||||||
{SETSTYLE=admin_menu}
|
{SETSTYLE=admin_menu}
|
||||||
{ADMIN_MENU}
|
{ADMIN_MENU}
|
||||||
{ADMIN_PWORD}
|
{ADMIN_PWORD}
|
||||||
|
@@ -5,7 +5,7 @@ define("SEP"," <span class='fa fa-play e-breadcrumb'></span> ");
|
|||||||
define("BOOTSTRAP", 3);
|
define("BOOTSTRAP", 3);
|
||||||
define('FONTAWESOME', 4);
|
define('FONTAWESOME', 4);
|
||||||
|
|
||||||
|
e107::js("theme", "js/bootstrap3.js", 'jquery');
|
||||||
|
|
||||||
// e107::js("url", "https://netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js",'jquery', 2);
|
// e107::js("url", "https://netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js",'jquery', 2);
|
||||||
// e107::css('url', 'http://netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css');
|
// e107::css('url', 'http://netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css');
|
||||||
|
52
e107_themes/bootstrap3/js/bootstrap3.js
vendored
Normal file
52
e107_themes/bootstrap3/js/bootstrap3.js
vendored
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
var e107 = e107 || {'settings': {}, 'behaviors': {}};
|
||||||
|
|
||||||
|
(function ($)
|
||||||
|
{
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes draggable panels on the dashboard.
|
||||||
|
*
|
||||||
|
* @type {{attach: e107.behaviors.adminDashboardDraggablePanels.attach}}
|
||||||
|
*/
|
||||||
|
e107.behaviors.adminDashboardDraggablePanels = {
|
||||||
|
attach: function (context, settings)
|
||||||
|
{
|
||||||
|
var selector = '.draggable-panels';
|
||||||
|
var onceKey = 'admin-dashboard-draggable-panels';
|
||||||
|
|
||||||
|
$(context).find(selector).once(onceKey).each(function ()
|
||||||
|
{
|
||||||
|
var $panel = $(this);
|
||||||
|
|
||||||
|
$panel.sortable({
|
||||||
|
connectWith: selector,
|
||||||
|
handle: '.panel-heading',
|
||||||
|
cursor: 'move',
|
||||||
|
placeholder: 'placeholder',
|
||||||
|
forcePlaceholderSize: true,
|
||||||
|
opacity: 0.4,
|
||||||
|
stop: function (event, ui)
|
||||||
|
{
|
||||||
|
var SortOrder = "SortOrder:\n";
|
||||||
|
var i = 0;
|
||||||
|
|
||||||
|
$(selector + " .panel-title").each(function ()
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
var $this = $(this);
|
||||||
|
var title = $this.text();
|
||||||
|
SortOrder += i + " - " + title + "\n";
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(SortOrder);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$panel.disableSelection();
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
})(jQuery);
|
Reference in New Issue
Block a user