redmine-view-customize-scripts icon indicating copy to clipboard operation
redmine-view-customize-scripts copied to clipboard

change background depend in tracker id when new or edit issue

Open ashrafalzyoud opened this issue 2 years ago • 6 comments

im try this code depend in your example https://github.com/onozaty/redmine-view-customize-scripts/blob/master/examples/0043.change_style_according_to_input_value/example.md

this my code

$(function() {
function changeBackground(color) {
   document.body.style.background = color;
}

    const setup = function(trackerid) {
    const trackerid = $('#issue_tracker_id').val();
    const applyStyle = function() {

      if (trackerid.val() == '128' || trackerid.val() == '126') {
      window.addEventListener("load",function() { changeBackground('red') });

      } else {
      window.addEventListener("load",function() { changeBackground('yellow') });

      }
    };

    trackerid.on('change', applyStyle);

    applyStyle();
  }

  // Note: Change the ID according to the custom field you want to target.
  setup($('#issue_tracker_id'));


});

ashrafalzyoud avatar Aug 11 '22 00:08 ashrafalzyoud

The code is not likely to work as JavaScript. I think you see an error in the DevTools console of the browser, so can you try to solve this problem by looking at it?

Thanks.

onozaty avatar Aug 11 '22 01:08 onozaty

Ok brother I will try Thx for replay me

ashrafalzyoud avatar Aug 11 '22 01:08 ashrafalzyoud

Can u help to code it Because our user dismiss change tracker Because that I need change background the page depends in tracker id

ashrafalzyoud avatar Aug 25 '22 12:08 ashrafalzyoud

Again, I am not your coder. I think you should hire an engineer who understands JavaScript. No knowledge of Redmine is required.

Repeated inquiries by you are already beyond the scope of our support as plugin authors.

onozaty avatar Aug 26 '22 16:08 onozaty

Again, I am not your coder. I think you should hire an engineer who understands JavaScript. No knowledge of Redmine is required.

Repeated inquiries by you are already beyond the scope of our support as plugin authors.

If you would be my sponsor, I might be able to be a little more responsive 😉.

  • https://github.com/sponsors/onozaty

onozaty avatar Aug 27 '22 00:08 onozaty

This issue is stale because it has been open for 60 days with no activity.

github-actions[bot] avatar Oct 26 '22 02:10 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Nov 10 '22 02:11 github-actions[bot]