commit fd46c8b243efdc5a248c4160ef4f17072f7d59a6
parent 27bfeb3e6b51b86dae06c41dc3aa00b467c32507
Author: Jan Dankert <devnull@localhost>
Date: Thu, 25 Oct 2012 20:35:34 +0200
Anklicken von View über ein eigenes JQuery-Plugin "orLoadView".
Diffstat:
3 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/themes/default/js/openrat.js b/themes/default/js/openrat.js
@@ -121,15 +121,9 @@ function refreshWorkbench()
// OnClick-Handler für Klick auf einen Tab-Reiter.
$('ul.views > li.action').click( function() {
- //alert("klicke auf "+$(this).html() );
- var method = $(this).attr('data-method');
- var p = $(this).closest('div.frame');
- var action = p.attr('data-action');
- var id = p.attr('data-id');
- p.find('ul.views li.active').removeClass('active');
- $(this).addClass('active');
- loadView( p.find('div.content'),createUrl(action,method,id));
+ $(this).orLoadView();
});
+
$('div.menu').dblclick( function()
{
fullscreen( this );
diff --git a/themes/default/js/plugin/jquery-plugin-orLoadView.js b/themes/default/js/plugin/jquery-plugin-orLoadView.js
@@ -0,0 +1,18 @@
+/**
+ * Baum darstellen.
+ */
+jQuery.fn.orLoadView = function()
+{
+ $(this).each(function(idx,treeEl)
+ {
+ var method = $(this).attr('data-method');
+ var frame = $(this).closest('div.frame');
+ var action = frame.attr('data-action');
+ var id = frame.attr('data-id');
+ frame.find('ul.views li.active').removeClass('active');
+ $(this).addClass('active');
+ loadView( frame.find('div.content'),createUrl(action,method,id));
+ });
+
+
+};+
\ No newline at end of file
diff --git a/themes/default/layout/index.php b/themes/default/layout/index.php
@@ -40,6 +40,7 @@
<script src="<?php echo OR_THEMES_EXT_DIR ?>default/js/plugin/jquery-plugin-orSearch.js"></script>
<script src="<?php echo OR_THEMES_EXT_DIR ?>default/js/plugin/jquery-plugin-orLinkify.js"></script>
<script src="<?php echo OR_THEMES_EXT_DIR ?>default/js/plugin/jquery-plugin-orTree.js"></script>
+ <script src="<?php echo OR_THEMES_EXT_DIR ?>default/js/plugin/jquery-plugin-orLoadView.js"></script>
<!--
<script src="<?php echo OR_THEMES_EXT_DIR ?>../editor/wymeditor/wymeditor/jquery.wymeditor.min.js"></script>
-->