1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-04 02:09:23 +02:00

Add unobserve equivalent in jQuery

This commit is contained in:
Afterster 2013-11-21 00:35:17 +01:00
parent 8573544594
commit 14caca09c7
4 changed files with 9 additions and 3 deletions

View file

@ -58,7 +58,7 @@ class Ajax
} }
$observe = "<script type=\"text/javascript\">"; $observe = "<script type=\"text/javascript\">";
$observe .= "$($source_txt).$method(function(e){" . $action . ";});"; $observe .= "$($source_txt).on('$method', function(){" . $action . ";});";
$observe .= "</script>"; $observe .= "</script>";
return $observe; return $observe;

View file

@ -27,12 +27,18 @@ $(document).ajaxComplete(function () {
// Post the contents of a form. // Post the contents of a form.
function ajaxPost(url, input, source) { function ajaxPost(url, input, source) {
//$('#' + input) //$('#' + input)
if ($(source)) {
$(source).off('click', function(){ ajaxPost(url, input, source); });
}
$.ajax(url, { success: processContents, type: 'post', data: $('#'+input).serialize() }); $.ajax(url, { success: processContents, type: 'post', data: $('#'+input).serialize() });
} // ajaxPost } // ajaxPost
// ajaxPut // ajaxPut
// Get response from the specified URL. // Get response from the specified URL.
function ajaxPut(url, source) { function ajaxPut(url, source) {
if ($(source)) {
$(source).off('click', function(){ ajaxPut(url, source); });
}
$.ajax(url, { success: processContents, type: 'post', dataType: 'xml' }); $.ajax(url, { success: processContents, type: 'post', dataType: 'xml' });
} // ajaxPut } // ajaxPut

View file

@ -64,7 +64,7 @@ var SearchRow = {
$('searchtable').appendChild(row); $('searchtable').appendChild(row);
rowCount++; rowCount++;
$(cells[3]).click(function(e){if(rowCount > 1) { Element.remove(this.parentNode); rowCount--; }}); $(cells[3]).on('click', function(){if(rowCount > 1) { Element.remove(this.parentNode); rowCount--; }});
rowIter++; rowIter++;
}, },

View file

@ -164,7 +164,7 @@ foreach ($playlist->urls as $item) {
swfPath: "<?php echo Config::get('web_path'); ?>/modules/jplayer/", swfPath: "<?php echo Config::get('web_path'); ?>/modules/jplayer/",
supplied: "<?php echo join(",", $jtypes); ?>", supplied: "<?php echo join(",", $jtypes); ?>",
audioFullScreen: true, audioFullScreen: true,
solution: "html5, flash", solution: "html, flash",
size: { size: {
<?php <?php
if ($iframed) { if ($iframed) {