Please login or register to participate.
Blog Post

Smart collections criteria fix until Cyn.in update

.

To a problem discussed here:

CODE FIX!! Regarding: http://www.cynapse.com/community/home/cyn.in-users/smart-collection.-upon-adding-smart-collection-from-firefox-what-ever-i-select-for-a-criteria-as-an-selection-in-a-select-box-i-actual-get-a-inside-html-code-of-select-box.-in-intern

Login as siteadmin, go to Site Settings and add the following code to the JavaScript for web statistics support

<script type="text/javascript">
<!--
/* HELPFUL FUNCTIONS */
function fix_colat() {
  if ($('form[name="criteria_select"] select#criterion_type option').length <= 0) {
    $('form[name="criteria_select"] select#criterion_type').html($('form[name="criteria_select"] select#criterion_type').text());
  }
}

/* RUN MAIN FUNCTION */
$(document).ready(function () {
  $('form[name="criteria_select"] select#criterion_type').change(function () { fix_colat();});
  fix_colat();
});
-->
</script>

As always, you are free to comment the temporary fix :) Please note that when cyn.in 3.0.6 comes out you should remove this code and see how it works then :)

Description
A javascript to automatically fix Smart Collections criteria for time being
Comments (2)
dhiraj Dec 14, 2009 08:58 PM
Hmmm... interesting jQuery hackery, this! :) + :o

Interesting point in question, though: Would it make sense to allow developers a more defined way, than above, to customize the current (already bloated) jQuery document.ready() function? Current is there in jq.cynin_custom.js in src -> ubify.viewlets -> browser, btw.

Will be looking at adding a "proper" fix for this really shortly in Cyn.in svn trunk, will update here when committed.
hexbin Dec 15, 2009 11:09 AM
I'm quite shure you will :D But, I just had to do something that I don't need to use FireBug till then :)... Hm... jQuery hackery? I do that all the time :D ... Good think I am not dreaming jQuery :D... And as for jQuery ... Add something as Advanced Site Admin section, and jQuery ready window there :D (just idea)
 
Loading