diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-11-06 07:34:56 -0800 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-11-06 07:34:56 -0800 |
commit | a2d5d8091f68263812624f8ed1092cbf5338e744 (patch) | |
tree | c03f8a4591752aca0fb8cdec37d1ce8e9a1d9064 /modules/tag/views | |
parent | 04c10a0720b57bc4b6273ea7127d9880c2c28354 (diff) |
The ajaxify_tag_form was not being called when the block was created. Moved the code to ajaxify the add form into the block html and deleted tag.js. Fixes Ticket #872
Diffstat (limited to 'modules/tag/views')
-rw-r--r-- | modules/tag/views/tag_block.html.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/modules/tag/views/tag_block.html.php b/modules/tag/views/tag_block.html.php index ad36b297..00b57360 100644 --- a/modules/tag/views/tag_block.html.php +++ b/modules/tag/views/tag_block.html.php @@ -1,7 +1,7 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> -<script language="text/javascript"> +<script type="text/javascript"> $("#g-add-tag-form").ready(function() { - var url = $("#g-tag-cloud").attr("title") + "/autocomplete"; + var url = $("#g-tag-cloud").attr("ref") + "/autocomplete"; $("#g-add-tag-form input:text").autocomplete( url, { max: 30, @@ -10,9 +10,20 @@ cacheLength: 1 } ); + $("#g-add-tag-form").ajaxForm({ + dataType: "json", + success: function(data) { + if (data.result == "success") { + $.get($("#g-tag-cloud").attr("ref"), function(data, textStatus) { + $("#g-tag-cloud").html(data); + }); + } + $("#g-add-tag-form").resetForm(); + } + }); }); </script> -<div id="g-tag-cloud" title="<?= url::site("tags") ?>"> +<div id="g-tag-cloud" ref="<?= url::site("tags") ?>"> <?= $cloud ?> </div> <?= $form ?>
\ No newline at end of file |