CommentFileSizeAuthor
#8 3135230-8.patch3.29 KBrsingh27
#2 3135230-2.patch2.74 KBrsingh27

Comments

rsingh27 created an issue. See original summary.

rsingh27’s picture

StatusFileSize
new2.74 KB
rsingh27’s picture

Status: Active » Needs review
rsingh27’s picture

Assigned: rsingh27 » Unassigned
baikho’s picture

Status: Needs review » Needs work

@rsingh27,

Thanks for your patch and sorry for the delay. I have looked at this and can see this would bring a few of the Webform attribute concepts into the FormElement, but I believe that should be ok for these output attributes.

diff --git a/js/range-slider.js b/js/range-slider.js
index 48501e9..a1e9a78 100644
--- a/js/range-slider.js
+++ b/js/range-slider.js
@@ -16,22 +16,26 @@
       var elements = settings.range_slider && settings.range_slider.elements ? settings.range_slider.elements : null;
       $(context).find('.form-type-range-slider > input').once('rangeSlider').each(function () {
         var outputType = false;
+        var prefix = '';
+        var suffix = '';

Can we please define these variables as outputPrefix and outputSuffix as that would make a distinction on it relating to the output element?

 * @code
 * $form['quantity'] = [
 *   '#type' => 'range_slider',
 *   '#title' => $this->t('Quantity'),
 *   '#data-orientation' => 'vertical',
 *   '#output' => 'below',
 * ];
 * @endcode

Can we also update the code example in the RangeSlider annotation with the new attributes?

  /**
   * {@inheritdoc}
   */
  public function getInfo() {
    return [
      '#process' => [
        [get_class($this), 'processRangeSlider'],
      ],
      '#data-orientation' => 'horizontal',
      '#output' => FALSE,
    ] + parent::getInfo();
  }

And can we also add the default values here as empty strings?

Other than that, this looks great, thank you very much!

rakesh.gectcr’s picture

rakesh.gectcr’s picture

rsingh27’s picture

Status: Needs work » Needs review
StatusFileSize
new3.29 KB

  • baikho committed 98ed362 on 8.x-1.x authored by rsingh27
    Issue #3135230 by rsingh27, baikho, Adam_Moulsdale: Prefix and Suffix...

baikho’s picture

Status: Needs review » Fixed

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.