/[drupal]/contributions/modules/xbview/xbview.js
ViewVC logotype

Contents of /contributions/modules/xbview/xbview.js

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Wed Nov 14 22:47:33 2007 UTC (2 years ago) by profix898
Branch: MAIN
CVS Tags: DRUPAL-6--1-0, HEAD
Branch point for: DRUPAL-6--1
Changes since 1.1: +32 -0 lines
File MIME type: text/javascript
- Initial version for Drupal 6
1 // $Id: xbview.js,v 1.1.2.2 2007/05/02 22:07:18 profix898 Exp $
2
3 Drupal.behaviors.xbview = function (context) {
4 $('a.xb-folder', context).each(function() {
5 $(this).bind('click', function() {
6 Drupal.xbviewFolder($(this).attr('id').substr(3));
7 return false;
8 });
9 });
10 };
11
12 Drupal.xbviewFolder = function(id) {
13 folder = $('#folder-'+id);
14 if (folder.html() == '') {
15 $('body').css('cursor', 'wait');
16 $.ajax({
17 url: Drupal.settings.xbview.callback+id,
18 error: function(http){
19 alert(Drupal.t('HTTP Request Failure (@status)', { '@status': http.status }));
20 },
21 success: function(data){
22 folder.hide().html(data).slideDown('normal');
23 Drupal.attachBehaviors('#folder-'+id);
24 },
25 complete: function(data){
26 $('body').css('cursor', 'default');
27 }
28 });
29 } else {
30 folder.slideUp('normal', function(){ $(this).empty(); });
31 }
32 };

  ViewVC Help
Powered by ViewVC 1.1.2