Fix slider

This commit is contained in:
YNH Webdev
2013-11-09 17:14:58 +01:00
parent 3895cf4399
commit 38f422896d
3 changed files with 27 additions and 12 deletions

View File

@@ -56,8 +56,8 @@ feature -- Rendering
do
temp := list.render
temp.append (slide_wrapper.render)
temp.append (render_tag_with_tagname ("a", "<span class=%"icon-prev%"></span>", "href=%"#" + control_name + "%" data-slide=%"prev%"", "left carousel-control"))
temp.append (render_tag_with_tagname ("a", "<span class=%"icon-next%"></span>", "href=%"#" + control_name + "%" data-slide=%"next%"", "right carousel-control"))
temp.append (render_tag_with_tagname ("a", "<span class=%"icon-prev%"></span>", "data-slide=%"prev%"", "left carousel-control"))
temp.append (render_tag_with_tagname ("a", "<span class=%"icon-next%"></span>", "data-slide=%"next%"", "right carousel-control"))
Result := render_tag (temp, "")
end
@@ -103,7 +103,7 @@ feature -- Change
item.add_class (cl)
end
slide_wrapper.add_control (item)
list.add_control (create {WSF_BASIC_CONTROL}.make_with_body_class ("li", "data-target=%"#" + control_name + "%" data-slide-to=%"" + list.controls.count.out + "%"", cl, ""));
list.add_control (create {WSF_BASIC_CONTROL}.make_with_body_class ("li", "data-slide-to=%"" + list.controls.count.out + "%"", cl, ""));
end
feature -- Properties

View File

@@ -308,10 +308,16 @@ class WSF_PAGE_CONTROL extends WSF_CONTROL
@$el.remove()
class WSF_SLIDER_CONTROL extends WSF_CONTROL
requirements: ['assets/bootstrap.min.js']
requirements: ['/assets/bootstrap.min.js']
attach_events: ()->
super
id = "slider"+Math.round(Math.random()*10000)
@$el.attr("id",id)
@$el.find("ol li").attr("data-target","#"+id)
@$el.find(".carousel-control").attr("href","#"+id)
class WSF_DROPDOWN_CONTROL extends WSF_CONTROL
requirements: ['assets/bootstrap.min.js']
requirements: ['/assets/bootstrap.min.js']
controls = {}
@@ -371,8 +377,8 @@ class WSF_CODEVIEW_CONTROL extends WSF_INPUT_CONTROL
constructor:()->
super
#load codemirror and then eiffel syntax
@initialize = lazy_load ['assets/codemirror/codemirror.js','assets/codemirror/codemirror.css','assets/codemirror/estudio.css'],
(lazy_load ['assets/codemirror/eiffel.js'], @attach_events, @),
@initialize = lazy_load ['/assets/codemirror/codemirror.js','/assets/codemirror/codemirror.css','/assets/codemirror/estudio.css'],
(lazy_load ['/assets/codemirror/eiffel.js'], @attach_events, @),
@
attach_events: () ->
@@ -595,7 +601,7 @@ class WSF_REPEATER_CONTROL extends WSF_CONTROL
show_alert = (action)->
alert(action.message)
start_modal = lazy_load ['assets/bootstrap.min.js'], (action)->
start_modal = lazy_load ['/assets/bootstrap.min.js'], (action)->
cssclass = ""
if action.type == "start_modal_big"
cssclass = " big"

View File

@@ -490,7 +490,16 @@ WSF_SLIDER_CONTROL = (function(_super) {
return WSF_SLIDER_CONTROL.__super__.constructor.apply(this, arguments);
}
WSF_SLIDER_CONTROL.prototype.requirements = ['assets/bootstrap.min.js'];
WSF_SLIDER_CONTROL.prototype.requirements = ['/assets/bootstrap.min.js'];
WSF_SLIDER_CONTROL.prototype.attach_events = function() {
var id;
WSF_SLIDER_CONTROL.__super__.attach_events.apply(this, arguments);
id = "slider" + Math.round(Math.random() * 10000);
this.$el.attr("id", id);
this.$el.find("ol li").attr("data-target", "#" + id);
return this.$el.find(".carousel-control").attr("href", "#" + id);
};
return WSF_SLIDER_CONTROL;
@@ -504,7 +513,7 @@ WSF_DROPDOWN_CONTROL = (function(_super) {
return WSF_DROPDOWN_CONTROL.__super__.constructor.apply(this, arguments);
}
WSF_DROPDOWN_CONTROL.prototype.requirements = ['assets/bootstrap.min.js'];
WSF_DROPDOWN_CONTROL.prototype.requirements = ['/assets/bootstrap.min.js'];
return WSF_DROPDOWN_CONTROL;
@@ -629,7 +638,7 @@ WSF_CODEVIEW_CONTROL = (function(_super) {
function WSF_CODEVIEW_CONTROL() {
WSF_CODEVIEW_CONTROL.__super__.constructor.apply(this, arguments);
this.initialize = lazy_load(['assets/codemirror/codemirror.js', 'assets/codemirror/codemirror.css', 'assets/codemirror/estudio.css'], lazy_load(['assets/codemirror/eiffel.js'], this.attach_events, this), this);
this.initialize = lazy_load(['/assets/codemirror/codemirror.js', '/assets/codemirror/codemirror.css', '/assets/codemirror/estudio.css'], lazy_load(['/assets/codemirror/eiffel.js'], this.attach_events, this), this);
}
WSF_CODEVIEW_CONTROL.prototype.attach_events = function() {
@@ -1012,7 +1021,7 @@ show_alert = function(action) {
return alert(action.message);
};
start_modal = lazy_load(['assets/bootstrap.min.js'], function(action) {
start_modal = lazy_load(['/assets/bootstrap.min.js'], function(action) {
var cssclass, modal;
cssclass = "";
if (action.type === "start_modal_big") {