-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nouislider: fixed rendering in higher angular version #319
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import noUiSlider from "nouislider"; | ||
|
||
function init(Survey) { | ||
export function init(Survey) { | ||
const iconId = "icon-nouislider"; | ||
Survey.SvgRegistry && Survey.SvgRegistry.registerIconFromSvg(iconId, require('svg-inline-loader?classPrefix!./images/nouislider.svg'), ""); | ||
var widget = { | ||
|
@@ -123,8 +123,6 @@ function init(Survey) { | |
}); | ||
question.updateSliderProperties = function () { | ||
const elems = document.getElementsByClassName("noUi-pips"); | ||
if (elems.length > 0) elems[elems.length - 1].style.display = "none"; | ||
if (elems.length > 1) elems[elems.length - 2].style.display = "none"; | ||
var getStart = function(currentStart) { | ||
return question.rangeMin + Math.round((currentStart - question.rangeMin) / question.step) * question.step; | ||
} | ||
|
@@ -226,10 +224,4 @@ function init(Survey) { | |
}, | ||
}; | ||
Survey.CustomWidgetCollection.Instance.addCustomWidget(widget, "customtype"); | ||
} | ||
|
||
if (typeof Survey !== "undefined") { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we remove this call, custom widget will not be registered in non-modular applications |
||
init(Survey); | ||
} | ||
|
||
export default init; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the "default" export cause problems with higher Angular versions? |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to remove this (and below) line?