Projet

Général

Profil

0001-orleans-highlight-widgets-with-errors-50565.patch

Serghei Mihai (congés, retour 15/05), 28 janvier 2021 14:59

Télécharger (1,54 ko)

Voir les différences:

Subject: [PATCH] orleans: highlight widgets with errors (#50565)

 static/orleans/_custom.scss | 15 +++++++++++++++
 static/orleans/extra.js     |  9 +++++++++
 2 files changed, 24 insertions(+)
static/orleans/_custom.scss
288 288
		}
289 289
	}
290 290
}
291

  
292
.widget {
293
	.content {
294
		display: inline-block;
295
		max-width: 100%;
296
		padding: .33em 0;
297
		transition: background 0.3s linear;
298
		&.with-padding {
299
			padding: .33em;
300
		}
301
	}
302
	&.widget-with-error .content {
303
		background-color: $notification_error_color;
304
	}
305
}
static/orleans/extra.js
2 2
  $('div.wcsformsofcategorycell').delegate('h2', 'click', function() {
3 3
    $(this).parents('div.wcsformsofcategorycell').toggleClass('toggled');
4 4
  });
5
  /* reset error class when contents is changed */
6
  var $widgets_with_error = $('.widget-with-error');
7
  if ($widgets_with_error.length) {
8
    $widgets_with_error
9
      .find('.content').addClass('with-padding')
10
      .on('change', 'input, select, textarea', function() {
11
        $(this).parents('.widget-with-error').removeClass('widget-with-error');
12
      })
13
  }
5 14
});
6
-