summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-11-06 07:34:56 -0800
committerTim Almdal <tnalmdal@shaw.ca>2009-11-06 07:34:56 -0800
commita2d5d8091f68263812624f8ed1092cbf5338e744 (patch)
treec03f8a4591752aca0fb8cdec37d1ce8e9a1d9064
parent04c10a0720b57bc4b6273ea7127d9880c2c28354 (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
-rw-r--r--modules/tag/helpers/tag_theme.php1
-rw-r--r--modules/tag/js/tag.js13
-rw-r--r--modules/tag/views/tag_block.html.php17
3 files changed, 14 insertions, 17 deletions
diff --git a/modules/tag/helpers/tag_theme.php b/modules/tag/helpers/tag_theme.php
index 76c0ea6b..e966821a 100644
--- a/modules/tag/helpers/tag_theme.php
+++ b/modules/tag/helpers/tag_theme.php
@@ -21,7 +21,6 @@ class tag_theme_Core {
static function head($theme) {
$theme->css("jquery.autocomplete.css");
$theme->script("jquery.autocomplete.js");
- $theme->script("tag.js");
$theme->css("tag.css");
}
diff --git a/modules/tag/js/tag.js b/modules/tag/js/tag.js
deleted file mode 100644
index 4760084d..00000000
--- a/modules/tag/js/tag.js
+++ /dev/null
@@ -1,13 +0,0 @@
-function ajaxify_tag_form() {
- $("#g-tag form").ajaxForm({
- dataType: "json",
- success: function(data) {
- if (data.result == "success") {
- $.get($("#g-tag-cloud").attr("title"), function(data, textStatus) {
- $("#g-tag-cloud").html(data);
- });
- }
- $("#g-tag form").resetForm();
- }
- });
-}
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